]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
LOC _exponent_of does not need to do division.
authorBob Halley <halley@dnspython.org>
Sat, 8 Aug 2020 14:21:37 +0000 (07:21 -0700)
committerBob Halley <halley@dnspython.org>
Sat, 8 Aug 2020 14:21:37 +0000 (07:21 -0700)
dns/rdtypes/ANY/LOC.py

index f3e3e121141f415def96478b567425194e64f1ea..c9e985b9b5f4ad3de5f6246de3d8e83c45efaabb 100644 (file)
@@ -34,17 +34,13 @@ _MIN_LATITUDE = 0x80000000 - 90 * 3600000
 _MAX_LONGITUDE = 0x80000000 + 180 * 3600000
 _MIN_LONGITUDE = 0x80000000 - 180 * 3600000
 
-# pylint complains about division since we don't have a from __future__ for
-# it, but we don't care about python 2 warnings, so turn them off.
-#
-# pylint: disable=old-division
 
 def _exponent_of(what, desc):
     if what == 0:
         return 0
     exp = None
     for (i, pow) in enumerate(_pows):
-        if what // pow == 0:
+        if what < pow:
             exp = i - 1
             break
     if exp is None or exp < 0: