aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/test_framework/authproxy.py
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-03-28 11:44:19 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-03-28 12:20:13 +0200
commitd7b80b54fbb73acc92ddee84697ac4cc10d4d336 (patch)
treebaff049446ff5e1f993139b6d9db777928bafeb9 /qa/rpc-tests/test_framework/authproxy.py
parent0b98dd7939674b61c28252d14b3fbd0f51d3912b (diff)
downloadbitcoin-d7b80b54fbb73acc92ddee84697ac4cc10d4d336.tar.xz
test_framework: Avoid infinite loop in encoding Decimal
Avoid an infinite loop in encoding, by ensuring EncodeDecimal returns a string. round(Decimal) used to convert it to float, but it no longer does in python 3.x. Strings are supported since #6380, so just use that.
Diffstat (limited to 'qa/rpc-tests/test_framework/authproxy.py')
-rw-r--r--qa/rpc-tests/test_framework/authproxy.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/qa/rpc-tests/test_framework/authproxy.py b/qa/rpc-tests/test_framework/authproxy.py
index fba469a0dd..cfc254da09 100644
--- a/qa/rpc-tests/test_framework/authproxy.py
+++ b/qa/rpc-tests/test_framework/authproxy.py
@@ -61,7 +61,7 @@ class JSONRPCException(Exception):
def EncodeDecimal(o):
if isinstance(o, decimal.Decimal):
- return round(o, 8)
+ return str(o)
raise TypeError(repr(o) + " is not JSON serializable")
class AuthServiceProxy(object):