3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 13:09:23 +01:00

pylink: better error message if PyLink isn't properly installed

This commit is contained in:
James Lu 2016-06-21 10:27:36 -07:00
parent 53ce5e26e0
commit d0bd064eda

10
pylink
View File

@ -1,9 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import os import os
import sys
# This must be done before conf imports, so we get the real conf instead of testing one. # This must be done before conf imports, so we get the real conf instead of testing one.
from pylinkirc import world try:
from pylinkirc import world
except ImportError:
sys.stderr.write("ERROR: Failed to import PyLink main module (pylinkirc.world).\n\nIf you are "
"running PyLink from source, please install PyLink first using 'python3 "
"setup.py install [--user]'\n")
sys.exit(1)
world.testing = False world.testing = False
from pylinkirc import conf, classes, utils, coreplugin from pylinkirc import conf, classes, utils, coreplugin