Patchwork D5844: check-py3-compat: provide filename to ast.parse()

login
register
mail settings
Submitter phabricator
Date Feb. 4, 2019, 11:38 p.m.
Message ID <f4db80ad3e9fb3a0087df1e1c0ddd91f@localhost.localdomain>
Download mbox | patch
Permalink /patch/38419/
State Not Applicable
Headers show

Comments

phabricator - Feb. 4, 2019, 11:38 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG01417ca7f2e2: check-py3-compat: provide filename to ast.parse() (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5844?vs=13771&id=13798

REVISION DETAIL
  https://phab.mercurial-scm.org/D5844

AFFECTED FILES
  contrib/check-py3-compat.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/contrib/check-py3-compat.py b/contrib/check-py3-compat.py
--- a/contrib/check-py3-compat.py
+++ b/contrib/check-py3-compat.py
@@ -45,7 +45,7 @@ 
         content = fh.read()
 
     try:
-        ast.parse(content)
+        ast.parse(content, filename=f)
     except SyntaxError as e:
         print('%s: invalid syntax: %s' % (f, e))
         return