Skip to content

Commit

Permalink
add pass test
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Mar 5, 2021
1 parent 7aacf43 commit 455147d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bugbear.py
Expand Up @@ -124,9 +124,10 @@ def _to_name_str(node):
# "pkg.mod.error", handling any depth of attribute accesses.
if isinstance(node, ast.Name):
return node.id
assert isinstance(node, ast.Attribute)
return _to_name_str(node.value) + "." + node.attr

try:
return _to_name_str(node.value) + "." + node.attr
except AttributeError:
return _to_name_str(node.value)

def _typesafe_issubclass(cls, class_or_tuple):
try:
Expand Down

0 comments on commit 455147d

Please sign in to comment.