From: Bob Halley Date: Mon, 3 Mar 2014 17:02:56 +0000 (-0800) Subject: In LOC, deal with 0 values for size, horizontal precision, and vertical precision. X-Git-Tag: v1.12.0-py3~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4e1e13ac1dfe0f5a7c76183bb9964cb4441ccac;p=thirdparty%2Fdnspython.git In LOC, deal with 0 values for size, horizontal precision, and vertical precision. --- diff --git a/dns/rdtypes/ANY/LOC.py b/dns/rdtypes/ANY/LOC.py index 64b50c9b..55662e06 100644 --- a/dns/rdtypes/ANY/LOC.py +++ b/dns/rdtypes/ANY/LOC.py @@ -24,6 +24,8 @@ _pows = (1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000) def _exponent_of(what, desc): + if what == 0: + return 0 exp = None for i in range(len(_pows)): if what // _pows[i] == 0: