We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd73a02 commit 1867fb3Copy full SHA for 1867fb3
1 file changed
codespell.py
@@ -5,6 +5,7 @@
5
import glob
6
import argparse
7
import re
8
+from pathlib import Path
9
10
from enchant.checker import SpellChecker
11
from enchant.tokenize import EmailFilter, URLFilter
@@ -195,9 +196,11 @@ def add_dict(enchant_dict, filename):
195
196
args = parse_args()
197
# print(args)
198
- thisdir = os.path.dirname(os.path.abspath(__file__))
199
+ initial_dct = Path(__file__) / 'additional_dictionary.txt'
200
+ if not initial_dct.exists():
201
+ initial_dct = None
202
- sitk_dict = DictWithPWL('en_US', thisdir+'/additional_dictionary.txt')
203
+ sitk_dict = DictWithPWL('en_US', initial_dct)
204
205
if args.dict is not None:
206
for d in args.dict:
0 commit comments