From: Bob Halley Date: Sat, 8 Aug 2020 14:21:37 +0000 (-0700) Subject: LOC _exponent_of does not need to do division. X-Git-Tag: v2.1.0rc1~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86ddcfd4eac493f0bcd38a824952e70567e4886b;p=thirdparty%2Fdnspython.git LOC _exponent_of does not need to do division. --- diff --git a/dns/rdtypes/ANY/LOC.py b/dns/rdtypes/ANY/LOC.py index f3e3e121..c9e985b9 100644 --- a/dns/rdtypes/ANY/LOC.py +++ b/dns/rdtypes/ANY/LOC.py @@ -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: