Skip to content

Fix PR #357 - #361

Merged
jmadler merged 1 commit into
PythonCharmers:masterfrom
flaviut:fix-pr-357
Sep 10, 2018
Merged

jmadler merged 1 commit into
PythonCharmers:masterfrom
flaviut:fix-pr-357

Conversation

@flaviut

@flaviut flaviut commented Sep 10, 2018 •

Copy link
Copy Markdown
Contributor

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.

  • py3.7 before: 5 failed, 998 passed, 35 skipped, 46 xfailed, 18 warnings in 19.53 seconds
  • py3.7 after: 5 failed, 999 passed, 35 skipped, 46 xfailed, 18 warnings in 20.20 seconds
  • py2.7 before: 1 failed, 996 passed, 25 skipped, 62 xfailed, 1 warnings in 29.88 seconds
  • py2.7 after: 1 failed, 997 passed, 25 skipped, 62 xfailed, 1 warnings in 30.60 seconds

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.
@flaviut flaviut mentioned this pull request Sep 10, 2018
@jmadler
jmadler merged commit c48ac2a into PythonCharmers:master Sep 10, 2018
@flaviut
flaviut deleted the fix-pr-357 branch September 10, 2018 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants