|
|
@@ -49,7 +49,10 @@ class AppRegistry(object):
|
|
|
def _open(self):
|
|
|
"""Open the registry file. May raise OSError"""
|
|
|
if os.path.exists(self._reg_path):
|
|
|
- reg_file = file(self._reg_path)
|
|
|
+ if sys.version_info[0] > 2:
|
|
|
+ reg_file = open(self._reg_path)
|
|
|
+ else:
|
|
|
+ reg_file = file(self._reg_path)
|
|
|
app_list = json.load(reg_file)
|
|
|
reg_file.close()
|
|
|
|
|
|
@@ -62,7 +65,10 @@ class AppRegistry(object):
|
|
|
|
|
|
def _write(self, path):
|
|
|
"""Write out the registry to the given path"""
|
|
|
- outfile = file(path, 'w')
|
|
|
+ if sys.version_info[0] > 2:
|
|
|
+ outfile = open(path, 'w')
|
|
|
+ else:
|
|
|
+ outfile = file(path, 'w')
|
|
|
json.dump(list(self._apps.values()), outfile, cls=AppJsonEncoder, indent=2)
|
|
|
outfile.close()
|
|
|
|