Commit d1ba202415c84d8686336df819c5f62495f5edb7
1 parent
00a2df08
msodde: remove unused imports and variable
Showing
1 changed file
with
1 additions
and
9 deletions
oletools/msodde.py
| @@ -49,7 +49,6 @@ http://www.decalage.info/python/oletools | @@ -49,7 +49,6 @@ http://www.decalage.info/python/oletools | ||
| 49 | from __future__ import print_function | 49 | from __future__ import print_function |
| 50 | 50 | ||
| 51 | import argparse | 51 | import argparse |
| 52 | -import zipfile | ||
| 53 | import os | 52 | import os |
| 54 | from os.path import abspath, dirname | 53 | from os.path import abspath, dirname |
| 55 | import sys | 54 | import sys |
| @@ -58,13 +57,6 @@ import logging | @@ -58,13 +57,6 @@ import logging | ||
| 58 | import re | 57 | import re |
| 59 | import csv | 58 | import csv |
| 60 | 59 | ||
| 61 | -# import lxml or ElementTree for XML parsing: | ||
| 62 | -try: | ||
| 63 | - # lxml: best performance for XML processing | ||
| 64 | - import lxml.etree as ET | ||
| 65 | -except ImportError: | ||
| 66 | - import xml.etree.cElementTree as ET | ||
| 67 | - | ||
| 68 | # little hack to allow absolute imports even if oletools is not installed | 60 | # little hack to allow absolute imports even if oletools is not installed |
| 69 | # Copied from olevba.py | 61 | # Copied from olevba.py |
| 70 | try: | 62 | try: |
| @@ -731,7 +723,7 @@ def process_xlsx(filepath): | @@ -731,7 +723,7 @@ def process_xlsx(filepath): | ||
| 731 | """ process an OOXML excel file (e.g. .xlsx or .xlsb or .xlsm) """ | 723 | """ process an OOXML excel file (e.g. .xlsx or .xlsb or .xlsm) """ |
| 732 | dde_links = [] | 724 | dde_links = [] |
| 733 | parser = ooxml.XmlParser(filepath) | 725 | parser = ooxml.XmlParser(filepath) |
| 734 | - for subfile, elem, _ in parser.iter_xml(): | 726 | + for _, elem, _ in parser.iter_xml(): |
| 735 | tag = elem.tag.lower() | 727 | tag = elem.tag.lower() |
| 736 | if tag == 'ddelink' or tag.endswith('}ddelink'): | 728 | if tag == 'ddelink' or tag.endswith('}ddelink'): |
| 737 | # we have found a dde link. Try to get more info about it | 729 | # we have found a dde link. Try to get more info about it |