Skip to content

Commit b9acb29

Browse files
committed
File IO bug fix
1 parent b836dcd commit b9acb29

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packet/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
app.config.from_pyfile(_pyfile_config)
2525

2626
# Fetch the version number from the npm package file
27-
_package_file = open(os.path.join(_root_dir, "package.json"))
28-
app.config["VERSION"] = json.load(_package_file)["version"]
27+
with open(os.path.join(_root_dir, "package.json")) as package_file:
28+
app.config["VERSION"] = json.load(package_file)["version"]
2929

3030
# Logger configuration
3131
logging.getLogger().setLevel(app.config["LOG_LEVEL"])

0 commit comments

Comments
 (0)