mirror of
https://github.com/bndr/pipreqs.git
synced 2025-06-06 03:25:21 +00:00
fix(pipreqs): correct regex for docstring
This commit is contained in:
parent
5a01ec01e9
commit
d9434a5ac9
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user