Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Incorrectly reporting unused imports for the 'as' syntax #253

Closed
hvdklauw opened this issue Oct 10, 2016 · 2 comments
Closed

Incorrectly reporting unused imports for the 'as' syntax #253

hvdklauw opened this issue Oct 10, 2016 · 2 comments
Labels

Comments

@hvdklauw
Copy link
Contributor

Versions

  • Flake8: 3.0.4 (flake8-docstrings: 1.0.2, pydocstyle: 1.0.0, pycodestyle: 2.0.0, mccabe: 0.5.2, pyflakes: 1.2.3) CPython 3.5.1 on Darwin
  • Linter-flake8: 1.13.4

Code to reproduce

from sys import path as sys_path

# Nothing here, just need to room to move add lines

Reported error
F401 — 'sys.path as sys_path' imported but unused at line 5 col 1 in test.py

Expected error
F401 — 'sys.path as sys_path' imported but unused at line 1 col 17 in test.py
With the whole of path as sys_path underlined.

@Arcanemagus
Copy link
Member

Just as an FYI, as part of the ES2017 re-write I'm working on I'm investigating this. I'm still not sure whether I want to keep the mass of code that is the "position fixing" and get it working properly, or just go back to the incorrect results from flake8...

@Arcanemagus
Copy link
Member

Fixed in #255. Although the specs don't show it, it does work with that syntax, it's just that the hacking module forces an older version of flake8 that only marks the alias.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants