aboutsummaryrefslogtreecommitdiff
path: root/devscripts/gh-pages/sign-versions.py
diff options
context:
space:
mode:
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)