aboutsummaryrefslogtreecommitdiff
path: root/src/utils/__init__.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-10-04 15:27:52 +0100
committerGravatar jesopo2018-10-04 15:27:52 +0100
commitf2d9ff9d3b70c9396e4a2b0106b2a5deb2578282 (patch)
tree51dce536731e5b555e3c410a81d77138456a3f50 /src/utils/__init__.py
parentNon-present hashflag values should be None, not empty string (diff)
signature
Checking for the presence of the seperator in the return from .partition is a
more "correct" way of doing this
Diffstat (limited to 'src/utils/__init__.py')
-rw-r--r--src/utils/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py
index 745a8864..4cdd141d 100644
--- a/src/utils/__init__.py
+++ b/src/utils/__init__.py
@@ -136,8 +136,8 @@ def get_hashflags(filename):
if not line.startswith("#"):
break
elif line.startswith("#--"):
- hashflag, _, value = line.replace("#--", "", 1).partition(" ")
- hashflags[hashflag] = value or None
+ hashflag, sep, value = line.replace[3:].partition(" ")
+ hashflags[hashflag] = value if sep else None
return hashflags.items()
class Docstring(object):