Skip to content

Commit f648175

Browse files
authored
Update parse.py
Test
1 parent 79cebad commit f648175

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gazelle/parse.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313

1414
def parse_import_statements(content, filepath):
1515
modules = list()
16-
tree = ast.parse(content)
16+
try:
17+
tree = ast.parse(content)
18+
except Exception as inst:
19+
raise('cannot parse', filepath, inst)
1720
for node in ast.walk(tree):
1821
if isinstance(node, ast.Import):
1922
for subnode in node.names:

0 commit comments

Comments
 (0)