Skip to content

Import after use gets removed #178

@tolomea

Description

@tolomea

With 0.7.4 and --remove --include-star-import --ignore-init --gitignore

In code like this

def bob():
    print(sys.path)

import sys

The import gets incorrectly removed.

You might reasonably ask why I even had code like this, in larger files my work flow is to just drop imports in the nearest bit of module level scope and let unimport and isort clean it up.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingchangelogChanges should be written to the changelog file.discussionIssue needs to be discussed and concluded.

Projects

Status

📋 Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions