Update remaining Python3 conventions
This commit is contained in:
parent
826135d5ed
commit
4cb368a8d9
|
@ -186,7 +186,7 @@ class AcceptBlockTest(BitcoinTestFramework):
|
||||||
if x['hash'] == blocks_h2f[1].hash:
|
if x['hash'] == blocks_h2f[1].hash:
|
||||||
assert_equal(x['status'], "valid-headers")
|
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.
|
# 4. Now send another block that builds on the forking chain.
|
||||||
blocks_h3 = []
|
blocks_h3 = []
|
||||||
|
@ -206,13 +206,13 @@ class AcceptBlockTest(BitcoinTestFramework):
|
||||||
# But this block should be accepted by node0 since it has more work.
|
# But this block should be accepted by node0 since it has more work.
|
||||||
try:
|
try:
|
||||||
self.nodes[0].getblock(blocks_h3[0].hash)
|
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:
|
except:
|
||||||
raise AssertionError("Unrequested more work block was not processed")
|
raise AssertionError("Unrequested more work block was not processed")
|
||||||
|
|
||||||
# Node1 should have accepted and reorged.
|
# Node1 should have accepted and reorged.
|
||||||
assert_equal(self.nodes[1].getblockcount(), 3)
|
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
|
# 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
|
# the last (height-too-high) on node0. Node1 should process the tip if
|
||||||
|
|
|
@ -167,7 +167,7 @@ def create_benchmark_archive(blk_hash):
|
||||||
|
|
||||||
js_txs = len([tx for tx in txs if len(tx['vjoinsplit']) > 0])
|
js_txs = len([tx for tx in txs if len(tx['vjoinsplit']) > 0])
|
||||||
if js_txs:
|
if js_txs:
|
||||||
print 'Block contains %d JoinSplit-containing transactions' % js_txs
|
print('Block contains %d JoinSplit-containing transactions' % js_txs)
|
||||||
return
|
return
|
||||||
|
|
||||||
inputs = [(x['txid'], x['vout']) for tx in txs for x in tx['vin'] if x.has_key('txid')]
|
inputs = [(x['txid'], x['vout']) for tx in txs for x in tx['vin'] if x.has_key('txid')]
|
||||||
|
|
|
@ -30,13 +30,13 @@ for filename in get_depends_sources_list():
|
||||||
print("Checking [" + filename + "] ...")
|
print("Checking [" + filename + "] ...")
|
||||||
|
|
||||||
if resp.status_code != 200:
|
if resp.status_code != 200:
|
||||||
print("FAIL. File not found on server: " + filename)
|
print("FAIL. File not found on server: ", filename)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
expected_size = os.path.getsize(os.path.join(DEPENDS_SOURCES_DIR, filename))
|
expected_size = os.path.getsize(os.path.join(DEPENDS_SOURCES_DIR, filename))
|
||||||
server_size = int(resp.headers['Content-Length'])
|
server_size = int(resp.headers['Content-Length'])
|
||||||
if expected_size != server_size:
|
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)
|
sys.exit(1)
|
||||||
|
|
||||||
print "PASS."
|
print "PASS."
|
||||||
|
|
|
@ -101,14 +101,14 @@ def document_authors():
|
||||||
## Writes release note to ./doc/release-notes based on git shortlog when current version number is specified
|
## Writes release note to ./doc/release-notes based on git shortlog when current version number is specified
|
||||||
def generate_release_note(version, prev, clear):
|
def generate_release_note(version, prev, clear):
|
||||||
filename = 'release-notes-{0}.md'.format(version)
|
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:
|
if prev:
|
||||||
latest_tag = prev
|
latest_tag = prev
|
||||||
else:
|
else:
|
||||||
# fetches latest tags, so that latest_tag will be correct
|
# fetches latest tags, so that latest_tag will be correct
|
||||||
subprocess.Popen(['git fetch -t'], shell=True, stdout=subprocess.PIPE).communicate()[0]
|
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()
|
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]
|
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 = notes.split('\n')
|
||||||
lines = [alias_authors_in_release_notes(line) for line in lines]
|
lines = [alias_authors_in_release_notes(line) for line in lines]
|
||||||
|
|
Loading…
Reference in New Issue