Skip to content

Commit 1d5881a

Browse files
Merge pull request #63 from MrMino/ast-trace-filename
On AST parsing errors, show the path to the file which triggered it.
2 parents d17aa5e + 6f68077 commit 1d5881a

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Release History
33
---------------
44

5+
2.2.2
6+
- AST parsing failures will now report tracebacks with a proper filename for
7+
the parsed frame, instead of `<unknown>`.
8+
59
2.2.1
610
- Python source is now always read using utf-8, even if default encoding for
711
reading files is set otherwise.

pip_check_reqs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.2.1'
1+
__version__ = '2.2.2'

pip_check_reqs/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def find_imported_modules(options):
122122
with open(filename, encoding='utf-8') as f:
123123
content = f.read()
124124
vis.set_location(filename)
125-
vis.visit(ast.parse(content))
125+
vis.visit(ast.parse(content, filename))
126126
return vis.finalise()
127127

128128

0 commit comments

Comments
 (0)