aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-02-17 18:25:55 +0530
committerArun Isaac2022-02-17 22:53:09 +0530
commit25a817bfa97fcb6d202397252e55bba088ead32d (patch)
tree1eddc899cc897abf9f9bd7ad5648bc77f9e5dab6
parentc147a6e75a9496263fd76f2eb9711ddf77a643ff (diff)
downloadgenenetwork2-25a817bfa97fcb6d202397252e55bba088ead32d.tar.gz
etc: Close VERSION file after opening.
Use a context manager so that the VERSION file is automatically closed on exiting the block. * etc/default_settings.py: Close VERSION file after opening.
-rw-r--r--etc/default_settings.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/etc/default_settings.py b/etc/default_settings.py
index 8636f4db..a0d01de0 100644
--- a/etc/default_settings.py
+++ b/etc/default_settings.py
@@ -24,7 +24,8 @@
import os
import sys
-GN_VERSION = open("../etc/VERSION", "r").read()
+with open("../etc/VERSION", "r") as version_file:
+ GN_VERSION = version_file.read()
# Redis
REDIS_URL = "redis://:@localhost:6379/0"