diff options
author | John Laxson <jl@revealtech.ai> | 2023-03-16 12:34:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-16 12:34:27 -0700 |
commit | c394c46fc1b21853bc68a7a47c1fe2db828d1dd0 (patch) | |
tree | ecfb1d67a3690fc0739e80a9c09343262d175270 /gazelle | |
parent | 31bc04bf93d555f8a9842c0ba2d3d243c4ac6cd4 (diff) | |
download | bazelbuild-rules_python-c394c46fc1b21853bc68a7a47c1fe2db828d1dd0.tar.gz |
fix: Include filename when parsing imports for gazelle (#1133)upstream/0.20.0
Diffstat (limited to 'gazelle')
-rw-r--r-- | gazelle/python/parse.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gazelle/python/parse.py b/gazelle/python/parse.py index 5cf0b89..6c0ef69 100644 --- a/gazelle/python/parse.py +++ b/gazelle/python/parse.py @@ -27,7 +27,7 @@ from tokenize import COMMENT, tokenize def parse_import_statements(content, filepath): modules = list() - tree = ast.parse(content) + tree = ast.parse(content, filename=filepath) for node in ast.walk(tree): if isinstance(node, ast.Import): for subnode in node.names: |