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 | 525 | else: |
| 526 | 526 | elem = curr_elem |
| 527 | 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 | 531 | # check if FLDCHARTYPE and whether "begin" or "end" tag |
| 531 | 532 | attrib_type = elem.attrib.get(ATTR_W_FLDCHARTYPE[0]) or \ |
| ... | ... | @@ -696,7 +697,7 @@ def process_xlsx(filepath): |
| 696 | 697 | record.link_type == \ |
| 697 | 698 | xls_parser.XlsbBeginSupBook.LINK_TYPE_DDE: |
| 698 | 699 | dde_links.append(record.string1 + ' ' + record.string2) |
| 699 | - except Exception: | |
| 700 | + except Exception as exc: | |
| 700 | 701 | if content_type.startswith('application/vnd.ms-excel.') or \ |
| 701 | 702 | content_type.startswith('application/vnd.ms-office.'): # pylint: disable=bad-indentation |
| 702 | 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 | 897 | |
| 897 | 898 | ole = olefile.OleFileIO(filepath, path_encoding=None) |
| 898 | 899 | if is_ppt(ole): |
| 899 | - log.debug('is ppt - cannot have DDE') | |
| 900 | + logger.debug('is ppt - cannot have DDE') | |
| 900 | 901 | return u'' |
| 901 | 902 | else: |
| 902 | 903 | logger.debug('Process file as word 2003 (doc)') | ... | ... |