From b646aa5093cd7d40edf9eee24d09bf67a4372b84 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Sat, 24 Jan 2009 02:56:53 +0000 Subject: [PATCH] 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. --- game/evennia.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/game/evennia.py b/game/evennia.py index d8a05e40d7..2826f0815b 100755 --- a/game/evennia.py +++ b/game/evennia.py @@ -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'