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:
Greg Taylor 2009-01-24 02:56:53 +00:00
parent 9250cb6446
commit b646aa5093

View file

@ -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'