Compare strings with == instead of is

`==` should be used when comparing values, `is` should be used to compare identities.
Modern versions of Python throw a SyntaxWarning.
This commit is contained in:
HexPandaa
2021-04-02 17:13:05 +02:00
committed by GitHub
parent 51f176633e
commit 7d96fa95c4

View File

@@ -11,7 +11,7 @@ else:
def StructWithLenPython2or3(endian,data): def StructWithLenPython2or3(endian,data):
#Python2... #Python2...
if PY2OR3 is "PY2": if PY2OR3 == "PY2":
return struct.pack(endian, data) return struct.pack(endian, data)
#Python3... #Python3...
else: else: