Skip to content

Commit d48a3d2

Browse files
committed
Use getattr_safe instead of AttrCleaner
This attribute lookup is covered by getattr_safe.
1 parent ddd4321 commit d48a3d2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

bpython/repl.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,12 +586,11 @@ def current_string(self, concatenate=False):
586586
return ""
587587
return "".join(string)
588588

589-
def get_object(self, name):
589+
def get_object(self, name: str) -> Any:
590590
attributes = name.split(".")
591591
obj = eval(attributes.pop(0), cast(Dict[str, Any], self.interp.locals))
592592
while attributes:
593-
with inspection.AttrCleaner(obj):
594-
obj = getattr(obj, attributes.pop(0))
593+
obj = inspection.getattr_safe(obj, attributes.pop(0))
595594
return obj
596595

597596
@classmethod

0 commit comments

Comments
 (0)