Skip to content

Commit 8350da6

Browse files
committed
removed unneed var
1 parent b15a9e9 commit 8350da6

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

comment_spell_check/utils/create_checker.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)