Commit ef36a777996379676de7be2265085ba26a75f292
1 parent
b844b306
msodde: no undefined variables
making pylint happier, part 3
Showing
1 changed file
with
4 additions
and
3 deletions
oletools/msodde.py
| @@ -525,7 +525,8 @@ def process_docx(filepath, field_filter_mode=None): | @@ -525,7 +525,8 @@ def process_docx(filepath, field_filter_mode=None): | ||
| 525 | else: | 525 | else: |
| 526 | elem = curr_elem | 526 | elem = curr_elem |
| 527 | if elem is None: | 527 | if elem is None: |
| 528 | - raise BadOOXML(filepath, 'Got "None"-Element from iter_xml') | 528 | + raise ooxml.BadOOXML(filepath, |
| 529 | + 'Got "None"-Element from iter_xml') | ||
| 529 | 530 | ||
| 530 | # check if FLDCHARTYPE and whether "begin" or "end" tag | 531 | # check if FLDCHARTYPE and whether "begin" or "end" tag |
| 531 | attrib_type = elem.attrib.get(ATTR_W_FLDCHARTYPE[0]) or \ | 532 | attrib_type = elem.attrib.get(ATTR_W_FLDCHARTYPE[0]) or \ |
| @@ -696,7 +697,7 @@ def process_xlsx(filepath): | @@ -696,7 +697,7 @@ def process_xlsx(filepath): | ||
| 696 | record.link_type == \ | 697 | record.link_type == \ |
| 697 | xls_parser.XlsbBeginSupBook.LINK_TYPE_DDE: | 698 | xls_parser.XlsbBeginSupBook.LINK_TYPE_DDE: |
| 698 | dde_links.append(record.string1 + ' ' + record.string2) | 699 | dde_links.append(record.string1 + ' ' + record.string2) |
| 699 | - except Exception: | 700 | + except Exception as exc: |
| 700 | if content_type.startswith('application/vnd.ms-excel.') or \ | 701 | if content_type.startswith('application/vnd.ms-excel.') or \ |
| 701 | content_type.startswith('application/vnd.ms-office.'): # pylint: disable=bad-indentation | 702 | content_type.startswith('application/vnd.ms-office.'): # pylint: disable=bad-indentation |
| 702 | # should really be able to parse these either as xml or records | 703 | # should really be able to parse these either as xml or records |
| @@ -896,7 +897,7 @@ def process_file(filepath, field_filter_mode=None): | @@ -896,7 +897,7 @@ def process_file(filepath, field_filter_mode=None): | ||
| 896 | 897 | ||
| 897 | ole = olefile.OleFileIO(filepath, path_encoding=None) | 898 | ole = olefile.OleFileIO(filepath, path_encoding=None) |
| 898 | if is_ppt(ole): | 899 | if is_ppt(ole): |
| 899 | - log.debug('is ppt - cannot have DDE') | 900 | + logger.debug('is ppt - cannot have DDE') |
| 900 | return u'' | 901 | return u'' |
| 901 | else: | 902 | else: |
| 902 | logger.debug('Process file as word 2003 (doc)') | 903 | logger.debug('Process file as word 2003 (doc)') |