Skip to content

Commit dfc4f30

Browse files
committed
Fix PR #357
Turns out that comments are associated with a specific AST node in python, and are not AST nodes on their own. Therefore, "continue" after detecting the shebang comment in fact causes the future import to be placed after the first AST node, which might be anything.
1 parent 685f221 commit dfc4f30

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/libfuturize/fixer_util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ def future_import(feature, node):
243243
# Is it a shebang or encoding line?
244244
if is_shebang_comment(node) or is_encoding_comment(node):
245245
shebang_encoding_idx = idx
246-
continue
247246
if is_docstring(node):
248247
# skip over docstring
249248
continue

0 commit comments

Comments
 (0)