Skip to content

Commit 14bbf74

Browse files
Removed __debug__ flag and added a TODO instead
1 parent 880c3bd commit 14bbf74

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

neo4j/io/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -802,16 +802,16 @@ def _handshake(s, resolved_address):
802802
"""
803803
local_port = s.getsockname()[1]
804804

805-
if __debug__:
806-
handshake = Bolt.get_handshake()
807-
import struct
808-
handshake = struct.unpack(">16B", handshake)
809-
handshake = [handshake[i:i + 4] for i in range(0, len(handshake), 4)]
805+
# TODO: Optimize logging code
806+
handshake = Bolt.get_handshake()
807+
import struct
808+
handshake = struct.unpack(">16B", handshake)
809+
handshake = [handshake[i:i + 4] for i in range(0, len(handshake), 4)]
810810

811-
supported_versions = [("0x%02X%02X%02X%02X" % (vx[0], vx[1], vx[2], vx[3])) for vx in handshake]
811+
supported_versions = [("0x%02X%02X%02X%02X" % (vx[0], vx[1], vx[2], vx[3])) for vx in handshake]
812812

813-
log.debug("[#%04X] C: <MAGIC> 0x%08X", local_port, int.from_bytes(Bolt.MAGIC_PREAMBLE, byteorder="big"))
814-
log.debug("[#%04X] C: <HANDSHAKE> %s %s %s %s", local_port, *supported_versions)
813+
log.debug("[#%04X] C: <MAGIC> 0x%08X", local_port, int.from_bytes(Bolt.MAGIC_PREAMBLE, byteorder="big"))
814+
log.debug("[#%04X] C: <HANDSHAKE> %s %s %s %s", local_port, *supported_versions)
815815

816816
data = Bolt.MAGIC_PREAMBLE + Bolt.get_handshake()
817817
s.sendall(data)

0 commit comments

Comments
 (0)