[Zope3-checkins] SVN: zope.testing/trunk/src/zope/testing/ Massive style cleanup: Move to new raise exception style; for motivation, see:

Martijn Pieters mj at zopatista.com
Tue Aug 30 18:01:11 EDT 2005


Log message for revision 38181:
  Massive style cleanup: Move to new raise exception style; for motivation, see:
  
    http://permalink.gmane.org/gmane.comp.web.zope.zope3/13884
  

Changed:
  U   zope.testing/trunk/src/zope/testing/doctest.py
  U   zope.testing/trunk/src/zope/testing/formparser.py
  U   zope.testing/trunk/src/zope/testing/module.py

-=-
Modified: zope.testing/trunk/src/zope/testing/doctest.py
===================================================================
--- zope.testing/trunk/src/zope/testing/doctest.py	2005-08-30 21:55:51 UTC (rev 38180)
+++ zope.testing/trunk/src/zope/testing/doctest.py	2005-08-30 22:01:11 UTC (rev 38181)
@@ -369,9 +369,9 @@
 # [XX] Normalize with respect to os.path.pardir?
 def _module_relative_path(module, path):
     if not inspect.ismodule(module):
-        raise TypeError, 'Expected a module: %r' % module
+        raise TypeError('Expected a module: %r' % module)
     if path.startswith('/'):
-        raise ValueError, 'Module-relative files may not have absolute paths'
+        raise ValueError('Module-relative files may not have absolute paths')
 
     # Find the base directory for the path.
     if hasattr(module, '__file__'):

Modified: zope.testing/trunk/src/zope/testing/formparser.py
===================================================================
--- zope.testing/trunk/src/zope/testing/formparser.py	2005-08-30 21:55:51 UTC (rev 38180)
+++ zope.testing/trunk/src/zope/testing/formparser.py	2005-08-30 22:01:11 UTC (rev 38181)
@@ -167,7 +167,7 @@
         for form in self:
             if form.name == name:
                 return form
-        raise AttributeError, name
+        raise AttributeError(name)
 
 
 class Form(dict):

Modified: zope.testing/trunk/src/zope/testing/module.py
===================================================================
--- zope.testing/trunk/src/zope/testing/module.py	2005-08-30 21:55:51 UTC (rev 38180)
+++ zope.testing/trunk/src/zope/testing/module.py	2005-08-30 22:01:11 UTC (rev 38181)
@@ -25,7 +25,7 @@
         try:
             return self.__dict[name]
         except KeyError:
-            raise AttributeError, name
+            raise AttributeError(name)
 
 def setUp(test, name='README.txt'):
     dict = test.globs



More information about the Zope3-Checkins mailing list