Merge pull request #4153 from asottile/syntax_warning_filename
Display the filename when encountering `SyntaxWarning`.
This commit is contained in:
commit
093e19a7d9
|
@ -0,0 +1 @@
|
|||
Display the filename when encountering ``SyntaxWarning``.
|
|
@ -398,7 +398,7 @@ def _rewrite_test(config, fn):
|
|||
finally:
|
||||
del state._indecode
|
||||
try:
|
||||
tree = ast.parse(source)
|
||||
tree = ast.parse(source, filename=fn.strpath)
|
||||
except SyntaxError:
|
||||
# Let this pop up again in the real import.
|
||||
state.trace("failed to parse: %r" % (fn,))
|
||||
|
|
Loading…
Reference in New Issue