[Checkins] SVN: Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/ Nice ImportError raised if you try to use twisted without having it,

Lennart Regebro regebro at gmail.com
Sun Apr 30 12:30:24 EDT 2006


Log message for revision 67771:
  Nice ImportError raised if you try to use twisted without having it,
  

Changed:
  U   Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py
  U   Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/datatypes.py

-=-
Modified: Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py
===================================================================
--- Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py	2006-04-30 16:25:51 UTC (rev 67770)
+++ Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/__init__.py	2006-04-30 16:30:23 UTC (rev 67771)
@@ -117,7 +117,7 @@
             config = getConfiguration()
             if config.twisted_servers:
                 if not _use_twisted:
-                    raise ValueError, "You do not have twisted installed."
+                    raise ImportError("You do not have twisted installed.")
                 twisted.internet.reactor.run()
             else:
                 import ZServer

Modified: Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/datatypes.py
===================================================================
--- Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/datatypes.py	2006-04-30 16:25:51 UTC (rev 67770)
+++ Zope/branches/regebro-wsgi_support2/lib/python/Zope2/Startup/datatypes.py	2006-04-30 16:30:23 UTC (rev 67771)
@@ -345,4 +345,5 @@
         pass
 except ImportError:
     class TwistedServerFactory:
-        pass
+        def __init__(self, section):
+            raise ImportError("You do not have twisted installed.")



More information about the Checkins mailing list