mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 10:16:32 +01:00
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__)))
|
||||
from django.conf import settings as settings_full
|
||||
from game import settings
|
||||
try:
|
||||
settings_full.configure()
|
||||
except RuntimeError:
|
||||
pass
|
||||
del sys, os
|
||||
from game import settings
|
||||
|
||||
try:
|
||||
import src.objects
|
||||
except (ImportError, AttributeError):
|
||||
err = "\nInitializing ev.py: The correct environment variables were not set."
|
||||
# test this first import to make sure environment is set up correctly
|
||||
from src.help.models import HelpEntry
|
||||
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 += " with everything set up correctly."
|
||||
raise ImportError(err)
|
||||
del src.objects
|
||||
err += " with everything configured correctly."
|
||||
raise AttributeError(err)
|
||||
|
||||
|
||||
######################################################################
|
||||
# Start Evennia API
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue