File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -30,26 +30,25 @@ def create_checker(dict_list: list[str] = None) -> spellchecker.SpellChecker:
3030 return checker
3131
3232 for d in dict_list :
33- dstring = str (d )
3433
3534 # load dictionary from URL
3635 try :
37- response = requests .get (dstring )
36+ response = requests .get (d )
3837 response .raise_for_status ()
3938 checker .word_frequency .load_text (response .text )
4039
4140 except requests .exceptions .MissingSchema :
4241 # URL didn't work so assume it's a local file path
4342 try :
44- checker .word_frequency .load_text_file (dstring )
43+ checker .word_frequency .load_text_file (d )
4544 except IOError :
46- logger .error ("Error loading %s" , dstring )
45+ logger .error ("Error loading %s" , d )
4746 continue
4847
4948 except requests .exceptions .RequestException as e :
50- logger .error ("Error loading dictionary from URL %s: %s" , dstring , e )
49+ logger .error ("Error loading dictionary from URL %s: %s" , d , e )
5150
52- logger .info ("Loaded %s" , dstring )
51+ logger .info ("Loaded %s" , d )
5352 logger .info ("%d words" , checker .word_frequency .unique_words )
5453
5554 return checker
You can’t perform that action at this time.
0 commit comments