From f09e57395f4b91e9c722b7444e214b094bd5f4dd Mon Sep 17 00:00:00 2001 From: mdr0id Date: Wed, 4 Dec 2019 07:43:21 -0800 Subject: [PATCH] update to py3 conventions, update range to return list for py3 --- qa/rpc-tests/timestampindex.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/qa/rpc-tests/timestampindex.py b/qa/rpc-tests/timestampindex.py index f795bd5bf..830d8b468 100755 --- a/qa/rpc-tests/timestampindex.py +++ b/qa/rpc-tests/timestampindex.py @@ -1,12 +1,10 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright (c) 2019 The Zcash developers # Distributed under the MIT software license, see the accompanying # file COPYING or https://www.opensource.org/licenses/mit-license.php . # # Test timestampindex generation and fetching for insightexplorer -import sys; assert sys.version_info < (3,), ur"This script does not run under Python 3. Please use Python 2.7.x." - import time from test_framework.test_framework import BitcoinTestFramework @@ -41,7 +39,7 @@ class TimestampIndexTest(BitcoinTestFramework): def run_test(self): blockhashes = [] - print "Mining blocks..." + print("Mining blocks...") for _ in range(8): blockhashes.extend(self.nodes[0].generate(1)) time.sleep(1) @@ -79,7 +77,7 @@ class TimestampIndexTest(BitcoinTestFramework): firsttime+10+1, firsttime, {'logicalTimes': True}) ltimes = [r['logicalts'] for r in results] - assert_equal(ltimes, range(firsttime, firsttime+10)) + assert_equal(ltimes, list(range(firsttime, firsttime+10))) # there's also a flag to exclude orphaned blocks; results should # be the same in this test