Skip to content

Commit 8c65661

Browse files
committed
refactor: Remove the use of exec reported by black/flint, closes #205
1 parent bddb7bb commit 8c65661

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,12 @@ def __init__(self):
6363
self.slurm_dir = None
6464
self.bgq = 0
6565

66+
# TODO - This needs an recode
6667
file_path = os.path.join(self.here, "pyslurm", "__version__.py")
67-
with open(file_path, "r", encoding="latin-1") as f:
68-
exec(f.read(), self.about)
68+
with open(file_path, "r", encoding="latin-1") as file_object:
69+
for line in file_object:
70+
(key, val) = line.strip("\n").split(' = ')
71+
self.about[key] = val.strip('"')
6972

7073
@staticmethod
7174
def usage():

0 commit comments

Comments
 (0)