THRIFT-3515 Python 2.6 compatibility and test on CI
This closes #766
diff --git a/lib/py/src/protocol/TJSONProtocol.py b/lib/py/src/protocol/TJSONProtocol.py
index acfce4a..3612e91 100644
--- a/lib/py/src/protocol/TJSONProtocol.py
+++ b/lib/py/src/protocol/TJSONProtocol.py
@@ -203,7 +203,7 @@
json_str.append('"')
self.trans.write(str_to_binary(''.join(json_str)))
- def writeJSONNumber(self, number, formatter='{}'):
+ def writeJSONNumber(self, number, formatter='{0}'):
self.context.write()
jsNumber = str(formatter.format(number)).encode('ascii')
if self.context.escapeNum():
@@ -550,7 +550,7 @@
def writeDouble(self, dbl):
# 17 significant digits should be just enough for any double precision value.
- self.writeJSONNumber(dbl, '{:.17g}')
+ self.writeJSONNumber(dbl, '{0:.17g}')
def writeString(self, string):
self.writeJSONString(string)