diff options
author | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-12-23 02:08:05 +0000 |
---|---|---|
committer | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-12-23 02:08:05 +0000 |
commit | 46ed74e8d456d7d2a983c6c86e2c347d8a5b4843 (patch) | |
tree | 36f35ae5ee48b75cfaa3465fca1adb49fd9c0b26 /python | |
parent | d0047c43d955174d79a2df623dbb4007965252b5 (diff) | |
download | protobuf-46ed74e8d456d7d2a983c6c86e2c347d8a5b4843.tar.gz protobuf-46ed74e8d456d7d2a983c6c86e2c347d8a5b4843.tar.bz2 protobuf-46ed74e8d456d7d2a983c6c86e2c347d8a5b4843.zip |
Actually, that last revision can be simpler -- we don't need to parse strings at all, as simply entering 1e1000 as a float literal in Python will be evaluated as infinity.
Diffstat (limited to 'python')
-rwxr-xr-x | python/google/protobuf/text_format.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/python/google/protobuf/text_format.py b/python/google/protobuf/text_format.py index 2def19c2..428e8c55 100755 --- a/python/google/protobuf/text_format.py +++ b/python/google/protobuf/text_format.py @@ -45,7 +45,7 @@ __all__ = [ 'MessageToString', 'PrintMessage', 'PrintField', # Infinity and NaN are not explicitly supported by Python pre-2.6, and # float('inf') does not work on Windows (pre-2.6). -_INFINITY = float('1e10000') +_INFINITY = 1e10000 # overflows, thus will actually be infinity. _NAN = _INFINITY * 0 |