mirror of
https://github.com/lgandx/Responder.git
synced 2025-08-20 05:13:34 -07:00
Alter "is" to "==" for Python 3.8 compatibility
Change the usage of "is" to "==" to comply with the new syntax warnings found in python >= 3.8 Observed warnings: RunFinger.py:61: SyntaxWarning: "is" with a literal. Did you mean "=="? if PY2OR3 is "PY2": RunFinger.py:68: SyntaxWarning: "is" with a literal. Did you mean "=="? if PY2OR3 is "PY2": RunFinger.py:74: SyntaxWarning: "is" with a literal. Did you mean "=="? if PY2OR3 is "PY2":
This commit is contained in:
parent
eb449bb061
commit
052c1a8285
1 changed files with 3 additions and 3 deletions
|
@ -58,20 +58,20 @@ 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:
|
||||||
return struct.pack(endian, data).decode('latin-1')
|
return struct.pack(endian, data).decode('latin-1')
|
||||||
|
|
||||||
def NetworkSendBufferPython2or3(data):
|
def NetworkSendBufferPython2or3(data):
|
||||||
if PY2OR3 is "PY2":
|
if PY2OR3 == "PY2":
|
||||||
return str(data)
|
return str(data)
|
||||||
else:
|
else:
|
||||||
return bytes(str(data), 'latin-1')
|
return bytes(str(data), 'latin-1')
|
||||||
|
|
||||||
def NetworkRecvBufferPython2or3(data):
|
def NetworkRecvBufferPython2or3(data):
|
||||||
if PY2OR3 is "PY2":
|
if PY2OR3 == "PY2":
|
||||||
return str(data)
|
return str(data)
|
||||||
else:
|
else:
|
||||||
return str(data.decode('latin-1'))
|
return str(data.decode('latin-1'))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue