浏览代码

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
Adam Cozzette 9 年之前
父节点
当前提交
b83af525db
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      python/google/protobuf/text_format.py

+ 2 - 2
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: