From f2d9ff9d3b70c9396e4a2b0106b2a5deb2578282 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 4 Oct 2018 15:27:52 +0100 Subject: Checking for the presence of the seperator in the return from .partition is a more "correct" way of doing this --- src/utils/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/utils') 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): -- cgit v1.3.1-10-gc9f91