diff options
author | Tobias Markmann <tm@ayena.de> | 2018-07-12 09:02:56 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2018-07-12 09:02:56 (GMT) |
commit | 95b04304452c4cf0a01f676a12779dacc6fa51a4 (patch) | |
tree | 9a8dce3db8213b68901893a0a6d371243684c3ee /BuildTools/Gource/GetGravatars.py | |
parent | 2bb40b14d3d7f5cebc56601dad066d5201040bd2 (diff) | |
download | swift-95b04304452c4cf0a01f676a12779dacc6fa51a4.zip swift-95b04304452c4cf0a01f676a12779dacc6fa51a4.tar.bz2 |
Fix Python 3 compatibility of our SCons and tooling Python code
For the upcoming update to Scons 3, which works with Python 2
and Python 3, this change makes our code compatible with
Python 3 so that it still works with Python 2.
Test-Information:
Tested these changes with SCons 3.0.1 on macOS 10.13.6 with
Python 2.7.15 and Python 3.7.0.
Change-Id: Idb5207b179a79a0dbe89d7e620d182a7d2f1ca6c
Diffstat (limited to 'BuildTools/Gource/GetGravatars.py')
-rwxr-xr-x | BuildTools/Gource/GetGravatars.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/BuildTools/Gource/GetGravatars.py b/BuildTools/Gource/GetGravatars.py index d1f40a4..17198aa 100755 --- a/BuildTools/Gource/GetGravatars.py +++ b/BuildTools/Gource/GetGravatars.py @@ -7,3 +7,3 @@ GRAVATAR_URL = "http://www.gravatar.com/avatar/%(id)s?d=404" if len(sys.argv) != 2 : - print "Usage: " + sys.argv[0] + " <output-dir>" + print("Usage: " + sys.argv[0] + " <output-dir>") sys.exit(-1) @@ -20,3 +20,3 @@ p.stdin.close() if p.wait() != 0 : - print "Error" + print("Error") sys.exit(-1) @@ -27,6 +27,6 @@ if not os.path.isdir(output_dir) : for email, name in authors.items() : - print "Processing avatar for " + name + " <" + email + ">" + print("Processing avatar for " + name + " <" + email + ">") filename = os.path.join(output_dir, name + ".png") if os.path.isfile(filename) : - print "-> Already there. Skipping." + print("-> Already there. Skipping.") continue @@ -36,3 +36,3 @@ for email, name in authors.items() : url = GRAVATAR_URL % {"id" : m.hexdigest()} - print "- Downloading " + url + print("- Downloading " + url) f = urllib.urlopen(url) @@ -43,3 +43,3 @@ for email, name in authors.items() : if input : - print "- Saving file " + filename + print("- Saving file " + filename) f = open(filename, "w") @@ -48,2 +48,2 @@ for email, name in authors.items() : else : - print "- No Gravatar found" + print("- No Gravatar found") |