An import check in ev.py acted weirdly in some situations. Changed to something more sensible.
This commit is contained in:
parent
f00053710c
commit
25f1d7b627
1 changed files with 9 additions and 7 deletions
16
ev.py
16
ev.py
|
|
@ -89,21 +89,23 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||||
from django.conf import settings as settings_full
|
from django.conf import settings as settings_full
|
||||||
from game import settings
|
|
||||||
try:
|
try:
|
||||||
settings_full.configure()
|
settings_full.configure()
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
pass
|
pass
|
||||||
del sys, os
|
del sys, os
|
||||||
|
from game import settings
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import src.objects
|
# test this first import to make sure environment is set up correctly
|
||||||
except (ImportError, AttributeError):
|
from src.help.models import HelpEntry
|
||||||
err = "\nInitializing ev.py: The correct environment variables were not set."
|
except AttributeError, e:
|
||||||
|
err = e.message
|
||||||
|
err += "\nError initializing ev.py: Maybe the correct environment variables were not set."
|
||||||
err += "\nUse \"python game/manage.py shell\" to start an interpreter"
|
err += "\nUse \"python game/manage.py shell\" to start an interpreter"
|
||||||
err += " with everything set up correctly."
|
err += " with everything configured correctly."
|
||||||
raise ImportError(err)
|
raise AttributeError(err)
|
||||||
del src.objects
|
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Start Evennia API
|
# Start Evennia API
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue