Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
populated authored May 3, 2024
1 parent 61f63f1 commit d8e5e7c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions curl_cffi/requests/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,15 @@ def has(cls, item):
return item in cls.__members__

@classmethod
def normalize(cls, item) -> 'BrowserType':
browser_map = {
"chrome": cls.chrome,
"safari": cls.safari,
"safari_ios": cls.safari_ios,
}
return browser_map.get(item, item)
def normalize(cls, item):
if item == "chrome": # noqa: SIM116
return cls.chrome
elif item == "safari":
return cls.safari
elif item == "safari_ios":
return cls.safari_ios
else:
return item

class BrowserSpec:
"""A more structured way of selecting browsers"""
Expand Down

0 comments on commit d8e5e7c

Please sign in to comment.