Merge PR #29095 into master

* refs/pull/29095/head:
	script/ptl-tool: update for python3

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Patrick Donnelly 2019-07-17 12:49:05 -07:00
commit 78564dcd0e
No known key found for this signature in database
GPG Key ID: 3A2A7E25BEA8AADB

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/python3
# README:
#
@ -215,8 +215,8 @@ def build_branch(args):
log.info("Detaching HEAD onto base: {}".format(base))
try:
base_path = args.base_path + base
base = filter(lambda r: r.path == base_path, G.refs)[0]
except IndexError:
base = next(ref for ref in G.refs if ref.path == base_path)
except StopIteration:
log.error("Branch " + base + " does not exist!")
sys.exit(1)