decalage2 / oletools

oletools - python tools to analyze MS OLE2 files (Structured Storage, Compound File Binary Format) and MS Office documents, for malware analysis, forensics and debugging.
http://www.decalage.info/python/oletools
Other
2.89k stars 565 forks source link

Fix a SyntaxWarning in Python 3.8+ #774

Closed vEpiphyte closed 1 year ago

vEpiphyte commented 2 years ago

Python 3.8+ now produces a SyntaxWarning when identify checks are used with certain literals. This was documented in the 3.8 release notes here https://docs.python.org/3/whatsnew/3.8.html#porting-to-python-3-8

On import, the oletools package currently produces a such a warning message:

/usr/local/lib/python3.8/dist-packages/oletools/oleobj.py:581: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if idx is -1:

This PR changes the identify check to a equality check.

vEpiphyte commented 1 year ago

Can this be included in 0.60.2 ?