Skip to content

Commit

Permalink
Fixed Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah committed Jan 16, 2020
1 parent d640b70 commit 22304ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions support/SimplerTestCase.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ def assertTrue(self, expr, msg=None):

@staticmethod
def load_ast_tree(filename):
with open(filename) as f:
fstr = f.read()
return ast.parse(fstr, filename=filename)
try:
with open(filename) as f:
fstr = f.read()
return ast.parse(fstr, filename=filename)
except:
return ast.parse("()")

@staticmethod
def check_keyword(keyword, arg, val_val=None, val_id=None, val_attr=None):
Expand All @@ -26,7 +29,7 @@ def check_keyword(keyword, arg, val_val=None, val_id=None, val_attr=None):
return True

def check_migration(self, migration_dir, model_name):
print(migration_dir, model_name)
# print(migration_dir, model_name)
for file in os.listdir(migration_dir):
full_path = os.path.join(migration_dir, file)
(path, ext) = os.path.splitext(full_path)
Expand Down

0 comments on commit 22304ab

Please sign in to comment.