mirror of
https://github.com/evennia/evennia.git
synced 2026-03-21 15:26:30 +01:00
As of Twisted 8.2, win32api is required for Windows. Try to import win32api before evennia.py hits Twisted and causes an un-friendly looking exception. If win32api isn't found, show an error message with the download URL.
This commit is contained in:
parent
9250cb6446
commit
b646aa5093
1 changed files with 10 additions and 0 deletions
|
|
@ -21,6 +21,16 @@ SERVER_PY_FILE = os.path.join(settings.SRC_DIR, 'server.py')
|
|||
# setting in settings.py to specify the path to the containing directory.
|
||||
if os.name == 'nt':
|
||||
TWISTED_BINARY = 'twistd.bat'
|
||||
try:
|
||||
import win32api
|
||||
except ImportError:
|
||||
print "=" * 78
|
||||
print """ERROR: Unable to import win32api, which Twisted requires to run. You may
|
||||
download it from:
|
||||
|
||||
http://starship.python.net/crew/mhammond/win32/Downloads.html"""
|
||||
print "=" * 78
|
||||
sys.exit()
|
||||
else:
|
||||
TWISTED_BINARY = 'twistd'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue