We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b9bbdd commit 5c79cf2Copy full SHA for 5c79cf2
aboot.py
@@ -72,7 +72,8 @@ def all():
72
class ABOOT(Serializable):
73
@classmethod
74
def create_from_json(cls, path):
75
- data = json.load(file(path, "rb"))
+ with open(path, "rb") as fh:
76
+ data = json.load(fh)
77
return ABOOT().set_data(data)
78
79
config.py
@@ -41,9 +41,11 @@ def get_config(cls):
41
global config
42
if not config:
43
config = Config()
44
- config.set_data(json.load(file(DATA_PATH, "rb")))
+ with open(DATA_PATH, "rb") as fh:
45
+ config.set_data(json.load(fh))
46
- data = "[root]\n"+file(USER_CONFIG_PATH, "rb").read()
47
+ with open(USER_CONFIG_PATH, "rb") as fh:
48
+ data = "[root]\n"+fh.read()
49
fp = io.BytesIO(data)
50
parser = ConfigParser.RawConfigParser()
51
parser.readfp(fp)
0 commit comments