From 46ed74e8d456d7d2a983c6c86e2c347d8a5b4843 Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Wed, 23 Dec 2009 02:08:05 +0000 Subject: 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. --- python/google/protobuf/text_format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python/google/protobuf') 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 -- cgit v1.2.3