Replace file() with open() for Python 3 compatibility
The built-in named 'file' has been removed since Python 3.0 [1] This patch replaces it by 'open' which is the same under Python 2 and 3. [1] https://docs.python.org/release/3.0/whatsnew/3.0.html#builtins Change-Id: Id39efad099358a76743693cc6e32bddca57e8e45
This commit is contained in:
parent
8d5288c2c4
commit
0101e2e932
@ -132,7 +132,7 @@ def set_host_enabled(self, arg_dict):
|
||||
|
||||
|
||||
def _write_config_dict(dct):
|
||||
conf_file = file(config_file_path, "w")
|
||||
conf_file = open(config_file_path, 'w')
|
||||
json.dump(dct, conf_file)
|
||||
conf_file.close()
|
||||
|
||||
@ -144,7 +144,7 @@ def _get_config_dict():
|
||||
is returned.
|
||||
"""
|
||||
try:
|
||||
conf_file = file(config_file_path)
|
||||
conf_file = open(config_file_path, 'r')
|
||||
config_dct = json.load(conf_file)
|
||||
conf_file.close()
|
||||
except IOError:
|
||||
|
Loading…
Reference in New Issue
Block a user