equal
deleted
inserted
replaced
43 """Check Python 3 compatibility of a file with Python 3.""" |
43 """Check Python 3 compatibility of a file with Python 3.""" |
44 with open(f, 'rb') as fh: |
44 with open(f, 'rb') as fh: |
45 content = fh.read() |
45 content = fh.read() |
46 |
46 |
47 try: |
47 try: |
48 ast.parse(content) |
48 ast.parse(content, filename=f) |
49 except SyntaxError as e: |
49 except SyntaxError as e: |
50 print('%s: invalid syntax: %s' % (f, e)) |
50 print('%s: invalid syntax: %s' % (f, e)) |
51 return |
51 return |
52 |
52 |
53 # Try to import the module. |
53 # Try to import the module. |