fixed code quality

This commit is contained in:
cis-kuldeep 2021-07-28 18:40:35 +05:30
parent 078c183ae9
commit 975775852d
No known key found for this signature in database
GPG Key ID: 67B47D8A06FA45E4

View File

@ -3,6 +3,7 @@ Low-level protocol-related functions.
""" """
# pylint: disable=too-many-boolean-expressions,too-many-return-statements # pylint: disable=too-many-boolean-expressions,too-many-return-statements
# pylint: disable=too-many-locals,too-many-statements # pylint: disable=too-many-locals,too-many-statements
# pylint: disable=R0204
import base64 import base64
import hashlib import hashlib
@ -199,17 +200,17 @@ def checkIPv4Address(host, hostStandardFormat, private=False):
otherwise returns False otherwise returns False
""" """
if six.PY2: if six.PY2:
IP_OCT1 = '\x7F' # 127/8 IP_OCT1 = '\x7F' # 127/8
IP_OCT2 = '\x0A' # 10/8 IP_OCT2 = '\x0A' # 10/8
IP_OCT3 = '\xC0\xA8' # 192.168/16 IP_OCT3 = '\xC0\xA8' # 192.168/16
IP_OCT4 = '\xAC\x10' # 172.16 IP_OCT4 = '\xAC\x10' # 172.16
IP_OCT5 = '\xAC\x20' # 12 IP_OCT5 = '\xAC\x20' # 12
else: else:
IP_OCT1 = 127 # 127/8 IP_OCT1 = 127 # 127/8
IP_OCT2 = 10 # 10/8 IP_OCT2 = 10 # 10/8
IP_OCT3 = b'\xC0\xA8' # 192.168/16 IP_OCT3 = b'\xC0\xA8' # 192.168/16
IP_OCT4 = b'\xAC\x10' # 172.16 IP_OCT4 = b'\xAC\x10' # 172.16
IP_OCT5 = b'\xAC\x20' # 12 IP_OCT5 = b'\xAC\x20' # 12
if host[0] == IP_OCT1: if host[0] == IP_OCT1:
if not private: if not private: