Skip to content

Commit b43481b

Browse files
committed
Change supscriptions in protocol.checkIPv4Address to have bytes in python3
1 parent 4a2c0c2 commit b43481b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/protocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ def checkIPv4Address(host, hostStandardFormat, private=False):
173173
Returns hostStandardFormat if it is an IPv4 address,
174174
otherwise returns False
175175
"""
176-
if host[0] == b'\x7F': # 127/8
176+
if host[0:1] == b'\x7F': # 127/8
177177
if not private:
178178
logger.debug(
179179
'Ignoring IP address in loopback range: %s',
180180
hostStandardFormat)
181181
return hostStandardFormat if private else False
182-
if host[0] == b'\x0A': # 10/8
182+
if host[0:1] == b'\x0A': # 10/8
183183
if not private:
184184
logger.debug(
185185
'Ignoring IP address in private range: %s', hostStandardFormat)

0 commit comments

Comments
 (0)