Skip to content

Commit caf7905

Browse files
author
Rahul Saini
authored
updated Details __getattr__ method
1 parent f42e4c7 commit caf7905

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ipinfo/details.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ def __init__(self, details):
1212

1313
def __getattr__(self, attr):
1414
"""Return attribute if it exists in details array, else return error."""
15-
if attr in self.details:
16-
return self.details[attr]
17-
18-
raise AttributeError(
19-
f"{attr} is not a valid attribute of Details"
20-
)
15+
if attr not in self.details:
16+
raise AttributeError(
17+
f"{attr} is not a valid attribute of Details"
18+
)
19+
20+
return self.details[attr]
2121

2222
@property
2323
def all(self):

0 commit comments

Comments
 (0)