[Zope-Checkins] SVN: Zope/branches/2.9/ Launchpad #373299: Removed bogus string exception in OFS.CopySupport.

Tres Seaver tseaver at palladion.com
Thu May 7 12:21:40 EDT 2009


Log message for revision 99799:
  Launchpad #373299: Removed bogus string exception in OFS.CopySupport.
  

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt
  U   Zope/branches/2.9/lib/python/OFS/CopySupport.py
  U   Zope/branches/2.9/lib/python/OFS/tests/testCopySupport.py

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.9/doc/CHANGES.txt	2009-05-07 16:16:01 UTC (rev 99798)
+++ Zope/branches/2.9/doc/CHANGES.txt	2009-05-07 16:21:40 UTC (rev 99799)
@@ -8,6 +8,8 @@
 
    Bugs fixed
 
+      - Launchpad #373299: Removed bogus string exception in OFS.CopySupport.
+
       - Launchpad ##332168: Connection.py: do not expose DB connection strings
         through exceptions
 

Modified: Zope/branches/2.9/lib/python/OFS/CopySupport.py
===================================================================
--- Zope/branches/2.9/lib/python/OFS/CopySupport.py	2009-05-07 16:16:01 UTC (rev 99798)
+++ Zope/branches/2.9/lib/python/OFS/CopySupport.py	2009-05-07 16:21:40 UTC (rev 99799)
@@ -44,7 +44,8 @@
 from OFS.interfaces import ICopySource
 
 
-CopyError='Copy Error'
+class CopyError(Exception):
+    pass
 
 copy_re = re.compile('^copy([0-9]*)_of_(.*)')
 

Modified: Zope/branches/2.9/lib/python/OFS/tests/testCopySupport.py
===================================================================
--- Zope/branches/2.9/lib/python/OFS/tests/testCopySupport.py	2009-05-07 16:16:01 UTC (rev 99798)
+++ Zope/branches/2.9/lib/python/OFS/tests/testCopySupport.py	2009-05-07 16:21:40 UTC (rev 99799)
@@ -347,7 +347,7 @@
             if ce_regex is not None:
 
                 pattern = re.compile( ce_regex, re.DOTALL )
-                if pattern.search( e ) is None:
+                if pattern.search(str(e)) is None:
                     self.fail( "Paste failed; didn't match pattern:\n%s" % e )
 
             else:
@@ -418,8 +418,6 @@
 
     def test_copy_cant_create_target_metatype_not_supported( self ):
 
-        from OFS.CopySupport import CopyError
-
         folder1, folder2 = self._initFolders()
         folder2.all_meta_types = ()
 
@@ -449,8 +447,6 @@
 
     def test_move_cant_read_source( self ):
 
-        from OFS.CopySupport import CopyError
-
         folder1, folder2 = self._initFolders()
         folder2.all_meta_types = FILE_META_TYPES
 
@@ -469,8 +465,6 @@
 
     def test_move_cant_create_target_metatype_not_supported( self ):
 
-        from OFS.CopySupport import CopyError
-
         folder1, folder2 = self._initFolders()
         folder2.all_meta_types = ()
 
@@ -484,8 +478,6 @@
 
     def test_move_cant_create_target_metatype_not_allowed( self ):
 
-        from OFS.CopySupport import CopyError
-
         folder1, folder2 = self._initFolders()
         folder2.all_meta_types = FILE_META_TYPES
 
@@ -503,7 +495,6 @@
 
     def test_move_cant_delete_source( self ):
 
-        from OFS.CopySupport import CopyError
         from AccessControl.Permissions import delete_objects as DeleteObjects
 
         folder1, folder2 = self._initFolders()



More information about the Zope-Checkins mailing list