From d9434a5ac96a34ea74266d1116b464d6e1f608cf Mon Sep 17 00:00:00 2001 From: Vadim Kravcenko Date: Wed, 20 Jan 2016 09:36:58 +0100 Subject: [PATCH] fix(pipreqs): correct regex for docstring --- pipreqs/pipreqs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipreqs/pipreqs.py b/pipreqs/pipreqs.py index 7e6d0c6..29bdd13 100755 --- a/pipreqs/pipreqs.py +++ b/pipreqs/pipreqs.py @@ -57,7 +57,7 @@ def get_all_imports(path, encoding=None): for file_name in files: with open_func(os.path.join(root, file_name), "r", encoding=encoding) as f: contents = re.sub(re.compile("'''.+?'''", re.DOTALL), '', f.read()) - contents = re.sub(re.compile('""".+"""', re.DOTALL), "", contents) + contents = re.sub(re.compile('""".+?"""', re.DOTALL), "", contents) lines = contents.split("\n") lines = filter( filter_line, map(lambda l: l.partition("#")[0].strip(), lines))