Skip to content

Commit 451960d

Browse files
committed
Disable duplicate-code check
It is not always possible to disable this check locally. See pylint-dev/pylint#214
1 parent 3142a83 commit 451960d

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

geoip2/models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ def __repr__(self) -> str:
339339
def network(self) -> Optional[Union[ipaddress.IPv4Network, ipaddress.IPv6Network]]:
340340
"""The network for the record"""
341341
# This code is duplicated for performance reasons
342-
# pylint: disable=duplicate-code
343342
network = self._network
344343
if isinstance(network, (ipaddress.IPv4Network, ipaddress.IPv6Network)):
345344
return network

geoip2/records.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,11 +864,10 @@ def __init__(
864864
self._network = network
865865
self._prefix_len = prefix_len
866866

867-
# This code is duplicated for performance reasons
868-
# pylint: disable=duplicate-code
869867
@property
870868
def network(self) -> Optional[Union[ipaddress.IPv4Network, ipaddress.IPv6Network]]:
871869
"""The network for the record"""
870+
# This code is duplicated for performance reasons
872871
network = self._network
873872
if isinstance(network, (ipaddress.IPv4Network, ipaddress.IPv6Network)):
874873
return network

pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[MESSAGES CONTROL]
2-
disable=C0330
2+
disable=C0330,duplicate-code
33

44
[BASIC]
55

0 commit comments

Comments
 (0)