Skip to content

Commit 7606737

Browse files
committed
Refactored get_asin
1 parent f198053 commit 7606737

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

amazon_paapi/tools/asin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Some useful tools."""
22

3-
from ..errors import AsinNotFoundException
43
import re
4+
from ..errors import AsinNotFoundException
55

66

77
def get_asin(text: str) -> str:
@@ -14,5 +14,5 @@ def get_asin(text: str) -> str:
1414
asin = re.search(r'(dp|gp/product|gp/aw/d|dp/product)/([a-zA-Z0-9]{10})', text)
1515
if asin:
1616
return asin.group(2)
17-
else:
18-
raise AsinNotFoundException('Asin not found: ' + text)
17+
18+
raise AsinNotFoundException('Asin not found: ' + text)

0 commit comments

Comments
 (0)