Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 297b039

Browse files
committed
Don't allow an IOError, bubble it up since it's required to exist
1 parent 7f2e72f commit 297b039

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ua_parser/user_agent_parser.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,10 @@ def GetFilters(user_agent_string, js_user_agent_string=None,
448448

449449
# If UA_PARSER_YAML is not specified, load regexes from regexes.json
450450
if regexes is None:
451-
try:
452-
import json
451+
import json
453452

454-
with open(json_path) as fp:
455-
regexes = json.load(fp)
456-
except IOError:
457-
pass
453+
with open(json_path) as fp:
454+
regexes = json.load(fp)
458455

459456

460457
USER_AGENT_PARSERS = []

0 commit comments

Comments
 (0)