platform: syntax compatibility with antiquated Python versions for environment loader

This commit is contained in:
Roman Shevchenko
2014-07-22 18:35:43 +02:00
parent 2a101682ed
commit d7d7e88bde
+4 -1
View File
@@ -9,6 +9,9 @@ import sys
if len(sys.argv) != 2:
raise Error('Exactly one argument expected')
with open(sys.argv[1], 'w') as f:
f = open(sys.argv[1], 'w')
try:
for key, value in os.environ.items():
f.writelines([key, '=', value, '\0'])
finally:
f.close()