Skip to content

Commit

Permalink
Workaround Pyflakes bugs
Browse files Browse the repository at this point in the history
The Pyflakes bugs were mentioned in #18.
  • Loading branch information
myint committed Jun 16, 2017
1 parent ad7cc64 commit c07a90b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion autoflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,10 @@ def filter_code(source, additional_imports=None,
for line_number, module_name in unused_import_module_name(messages):
marked_unused_module[line_number].append(module_name)

if expand_star_import:
if expand_star_import and not (
re.search(r'\b__all__\b', source) or
re.search(r'\bdel\b', source)
):
marked_star_import_line_numbers = frozenset(
star_import_used_line_numbers(messages))
if len(marked_star_import_line_numbers) > 1:
Expand Down

0 comments on commit c07a90b

Please sign in to comment.