Make "gnome-shell --create-extension" compatible with Python 2.5
Fallback to using the json-py module on systems with a Python version older than 2.6 (which introduced native JSON support).
This commit is contained in:
parent
288eae91e2
commit
45f4292259
@ -260,7 +260,11 @@ use an extension title clicktofocus@janedoe.example.com.'''
|
||||
'description': description,
|
||||
'uuid': uuid }
|
||||
f = open(os.path.join(extension_path, 'metadata.json'), 'w')
|
||||
try:
|
||||
json.dump(meta, f)
|
||||
except AttributeError:
|
||||
# For Python versions older than 2.6, try using the json-py module
|
||||
f.write(json.write(meta) + '\n')
|
||||
f.close()
|
||||
|
||||
extensionjs_path = os.path.join(extension_path, 'extension.js')
|
||||
|
Loading…
Reference in New Issue
Block a user