aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-04 15:22:09 +0100
committerGravatar jesopo2018-10-04 15:22:09 +0100
commit8d3255c46d75f0cda7791a5a9904a5c38207e35d (patch)
tree2a25ab13aaa5be50890085842cd1088de0602e72 /src/utils
parentTry calling module.unload() (if it exists) when unloading a module (diff)
signature
Simplify hashflag parsing
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/__init__.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py
index dccc1faf..57980e58 100644
--- a/src/utils/__init__.py
+++ b/src/utils/__init__.py
@@ -136,12 +136,7 @@ def get_hashflags(filename):
if not line.startswith("#"):
break
elif line.startswith("#--"):
- line_split = line.split(" ", 1)
- hashflag = line_split[0][3:]
- value = None
-
- if len(line_split) > 1:
- value = line_split[1]
+ hashflag, _, value = line.replace("#--", "", 1).partition(" ")
hashflags[hashflag] = value
return hashflags.items()