Skip to content

Commit

Permalink
typecheck: Adding check for NoneType before calling is_descendant
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpark715 committed Aug 17, 2018
1 parent d56c646 commit a5d3075
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python_ta/typecheck/base.py
Expand Up @@ -660,8 +660,8 @@ def unify(self, t1: type, t2: type,
elif ct1 == Any or ct2 == Any:
return TypeInfo(ct1) if ct1 != Any else TypeInfo(ct2)
# Handle inheritance
elif self.type_store and \
self.type_store.is_descendant(ct1, ct2):
elif self.type_store and ct1 is not None and ct2 is not None \
and self.type_store.is_descendant(ct1, ct2):
return TypeInfo(ct1)
else:
for tn in [tnode1, tnode2]:
Expand Down

0 comments on commit a5d3075

Please sign in to comment.