Skip to content

Commit 19cc554

Browse files
committed
Added module loading for package script
1 parent 1b40eb0 commit 19cc554

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

comment_spell_check/comment_spell_check.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@
3333

3434
from spellchecker import SpellChecker
3535

36-
from lib import bibtex_loader
37-
from lib import create_checker
36+
try:
37+
# This loads the modules from the installed package
38+
from comment_spell_check.lib import bibtex_loader
39+
from comment_spell_check.lib import create_checker
40+
except ImportError:
41+
# This loads the modules from the source directory
42+
from lib import bibtex_loader
43+
from lib import create_checker
3844

3945
__version__ = "unknown"
4046

0 commit comments

Comments
 (0)