@@ -170,7 +170,7 @@ def _repl(m):
170
170
if index < len (group ):
171
171
return group [index ]
172
172
return ''
173
-
173
+
174
174
_string = re .sub (r'\$(\d)' , _repl , string )
175
175
_string = re .sub (r'^\s+|\s+$' , '' , _string )
176
176
if _string == '' :
@@ -180,7 +180,7 @@ def _repl(m):
180
180
def Parse (self , user_agent_string ):
181
181
device , brand , model = None , None , None
182
182
match = self .user_agent_re .search (user_agent_string )
183
- if match :
183
+ if match :
184
184
if self .device_replacement :
185
185
device = self .MultiReplace (self .device_replacement , match )
186
186
else :
@@ -444,7 +444,7 @@ def GetFilters(user_agent_string, js_user_agent_string=None,
444
444
import yaml
445
445
446
446
yamlFile = open (UA_PARSER_YAML )
447
- regexes = yaml .load (yamlFile )
447
+ regexes = yaml .safe_load (yamlFile )
448
448
yamlFile .close ()
449
449
450
450
# If UA_PARSER_YAML is not specified, load regexes from regexes.json before
@@ -458,7 +458,7 @@ def GetFilters(user_agent_string, js_user_agent_string=None,
458
458
import yaml
459
459
460
460
yamlFile = open (yamlPath )
461
- regexes = yaml .load (yamlFile )
461
+ regexes = yaml .safe_load (yamlFile )
462
462
yamlFile .close ()
463
463
464
464
0 commit comments