We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f42e4c7 commit caf7905Copy full SHA for caf7905
ipinfo/details.py
@@ -12,12 +12,12 @@ def __init__(self, details):
12
13
def __getattr__(self, attr):
14
"""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
- )
+ if attr not in self.details:
+ raise AttributeError(
+ f"{attr} is not a valid attribute of Details"
+ )
+
+ return self.details[attr]
21
22
@property
23
def all(self):
0 commit comments