mirror of
https://github.com/lgandx/Responder.git
synced 2025-12-06 12:41:31 +00:00
Use == instead of is
`==` should be used when comparing values, `is` should be used to compare identities.
This commit is contained in:
@@ -47,20 +47,20 @@ SMB1 = "Enabled"
|
|||||||
|
|
||||||
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'))
|
||||||
|
|||||||
Reference in New Issue
Block a user