aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Cozzette <acozzette@google.com>2016-06-30 10:13:53 -0700
committerAdam Cozzette <acozzette@google.com>2016-06-30 10:13:53 -0700
commitb83af525db15954ebcfc103b4c6c2f08d68fb10e (patch)
tree4c4dc6f841bea3ffbd4db18838cd6fb745657817
parentd64a2d9941c36a7bc2a7959ea10ab8363192ac14 (diff)
downloadprotobuf-b83af525db15954ebcfc103b4c6c2f08d68fb10e.tar.gz
protobuf-b83af525db15954ebcfc103b4c6c2f08d68fb10e.tar.bz2
protobuf-b83af525db15954ebcfc103b4c6c2f08d68fb10e.zip
Fixed string formatting in text_format.py to be Python2.6-compatible
In Python 2.6 the positional argument specifiers are apparently required to be explicitly specified: http://stackoverflow.com/questions/10054122/valueerror-zero-length-field-name-in-format-python
-rwxr-xr-xpython/google/protobuf/text_format.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/google/protobuf/text_format.py b/python/google/protobuf/text_format.py
index c4b23c37..06b79d77 100755
--- a/python/google/protobuf/text_format.py
+++ b/python/google/protobuf/text_format.py
@@ -81,8 +81,8 @@ class ParseError(Error):
if message is not None and line is not None:
loc = str(line)
if column is not None:
- loc += ':{}'.format(column)
- message = '{} : {}'.format(loc, message)
+ loc += ':{0}'.format(column)
+ message = '{0} : {1}'.format(loc, message)
if message is not None:
super(ParseError, self).__init__(message)
else: