Skip to content

Commit 06dea5e

Browse files
authored
Merge pull request #90 from ProgramR4732/patch-1
updated f-strings & removed unnecessary else block.
2 parents 0832a01 + caf7905 commit 06dea5e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ipinfo/details.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ 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-
else:
15+
if attr not in self.details:
1816
raise AttributeError(
19-
"{} is not a valid attribute of Details".format(attr)
17+
f"{attr} is not a valid attribute of Details"
2018
)
2119

20+
return self.details[attr]
21+
2222
@property
2323
def all(self):
2424
"""Return all details as dict."""

0 commit comments

Comments
 (0)