aboutsummaryrefslogtreecommitdiff
path: root/devscripts/gh-pages/sign-versions.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-11-26 20:01:20 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-11-26 20:01:22 +0100
commitdcddc10a5032996474e157946b00b8df039eebda (patch)
treec0203ee3349bcae04bab970657e391f4fc255736 /devscripts/gh-pages/sign-versions.py
parenta1008af412f51aac82c121eaed07f742055d010b (diff)
[test_unicode_literals] Arm unicode_literals check
From now on, the line from __future__ import unicode_literals should be contained in every single Python file lest we run into any more 2.x/3.x issues. Going forward, we're likely to develop on 3.x only and would likely miss subtle bugs otherwise.
Diffstat (limited to 'devscripts/gh-pages/sign-versions.py')
-rwxr-xr-xdevscripts/gh-pages/sign-versions.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/devscripts/gh-pages/sign-versions.py b/devscripts/gh-pages/sign-versions.py
index 953a5162e..fa389c358 100755
--- a/devscripts/gh-pages/sign-versions.py
+++ b/devscripts/gh-pages/sign-versions.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
+from __future__ import unicode_literals, with_statement
import rsa
import json
@@ -29,4 +30,5 @@ signature = hexlify(rsa.pkcs1.sign(json.dumps(versions_info, sort_keys=True).enc
print('signature: ' + signature)
versions_info['signature'] = signature
-json.dump(versions_info, open('update/versions.json', 'w'), indent=4, sort_keys=True)
+with open('update/versions.json', 'w') as versionsf:
+ json.dump(versions_info, versionsf, indent=4, sort_keys=True)