Update remaining Python3 conventions

This commit is contained in:
mdr0id 2020-02-10 12:46:41 -08:00
parent 826135d5ed
commit 4cb368a8d9
4 changed files with 8 additions and 8 deletions

View File

@ -186,7 +186,7 @@ class AcceptBlockTest(BitcoinTestFramework):
if x['hash'] == blocks_h2f[1].hash:
assert_equal(x['status'], "valid-headers")
print "Second height 2 block accepted only from whitelisted peer"
print("Second height 2 block accepted only from whitelisted peer")
# 4. Now send another block that builds on the forking chain.
blocks_h3 = []
@ -206,13 +206,13 @@ class AcceptBlockTest(BitcoinTestFramework):
# But this block should be accepted by node0 since it has more work.
try:
self.nodes[0].getblock(blocks_h3[0].hash)
print "Unrequested more-work block accepted from non-whitelisted peer"
print("Unrequested more-work block accepted from non-whitelisted peer")
except:
raise AssertionError("Unrequested more work block was not processed")
# Node1 should have accepted and reorged.
assert_equal(self.nodes[1].getblockcount(), 3)
print "Successfully reorged to length 3 chain from whitelisted peer"
print("Successfully reorged to length 3 chain from whitelisted peer")
# 4b. Now mine 288 more blocks and deliver; all should be processed but
# the last (height-too-high) on node0. Node1 should process the tip if

View File

@ -167,7 +167,7 @@ def create_benchmark_archive(blk_hash):
js_txs = len([tx for tx in txs if len(tx['vjoinsplit']) > 0])
if js_txs:
print 'Block contains %d JoinSplit-containing transactions' % js_txs
print('Block contains %d JoinSplit-containing transactions' % js_txs)
return
inputs = [(x['txid'], x['vout']) for tx in txs for x in tx['vin'] if x.has_key('txid')]

View File

@ -30,13 +30,13 @@ for filename in get_depends_sources_list():
print("Checking [" + filename + "] ...")
if resp.status_code != 200:
print("FAIL. File not found on server: " + filename)
print("FAIL. File not found on server: ", filename)
sys.exit(1)
expected_size = os.path.getsize(os.path.join(DEPENDS_SOURCES_DIR, filename))
server_size = int(resp.headers['Content-Length'])
if expected_size != server_size:
print "FAIL. On the server, %s is %d bytes, but locally it is %d bytes." % (filename, server_size, expected_size)
print("FAIL. On the server, %s is %d bytes, but locally it is %d bytes." % (filename, server_size, expected_size))
sys.exit(1)
print "PASS."

View File

@ -101,14 +101,14 @@ def document_authors():
## Writes release note to ./doc/release-notes based on git shortlog when current version number is specified
def generate_release_note(version, prev, clear):
filename = 'release-notes-{0}.md'.format(version)
print "Automatically generating release notes for {0} from git shortlog. Should review {1} for accuracy.".format(version, filename)
print("Automatically generating release notes for {0} from git shortlog. Should review {1} for accuracy.".format(version, filename))
if prev:
latest_tag = prev
else:
# fetches latest tags, so that latest_tag will be correct
subprocess.Popen(['git fetch -t'], shell=True, stdout=subprocess.PIPE).communicate()[0]
latest_tag = subprocess.Popen(['git describe --abbrev=0'], shell=True, stdout=subprocess.PIPE).communicate()[0].strip()
print "Previous release tag: ", latest_tag
print("Previous release tag: ", latest_tag)
notes = subprocess.Popen(['git shortlog --no-merges {0}..HEAD'.format(latest_tag)], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE).communicate()[0]
lines = notes.split('\n')
lines = [alias_authors_in_release_notes(line) for line in lines]