Skip to content

Commit 3f6a141

Browse files
committed
Removed an unnecessary exception catch
1 parent 84c2d05 commit 3f6a141

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

nullsafe/core.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,8 @@ def __getitem__(self, k: str) -> Any:
5151
return undefined
5252

5353
def __getattr__(self, name: str) -> Any:
54-
try:
55-
val = getattr(self.__o, name)
56-
if val is None:
57-
return undefined
58-
return val
59-
except AttributeError:
60-
return undefined
54+
val = getattr(self.__o, name, undefined)
55+
return undefined if val is None else val
6156

6257
def __setattr__(self, name: str, value: Any) -> None:
6358
if name == "_NullSafeProxy__o":

0 commit comments

Comments
 (0)