fix new memory view error test in Py2.4
authorStefan Behnel <stefan_ml@behnel.de>
Sat, 26 Jan 2013 09:54:04 +0000 (10:54 +0100)
committerStefan Behnel <stefan_ml@behnel.de>
Sat, 26 Jan 2013 09:54:04 +0000 (10:54 +0100)
--HG--
extra : transplant_source : %8A%F1%17%5C%A7%CA%1C%B1%17%A1%C5t%06O%5BI%F2%19Vq

tests/memoryview/view_return_errors.pyx

index 1099095..8e94431 100644 (file)
@@ -1,4 +1,6 @@
 # mode: run
+# tag: memoryview
+
 
 cdef double[:] foo(int i):
     if i == 1:
@@ -10,22 +12,23 @@ cdef double[:] foo(int i):
     if i == 4:
         raise TypeError('dummy')
 
+
 def propagate(i):
-    '''
+    """
     >>> propagate(0)
-    TypeError('Memoryview return value is not initialized',)
+    TypeError('Memoryview return value is not initialized')
     >>> propagate(1)
-    AttributeError('dummy',)
+    AttributeError('dummy')
     >>> propagate(2)
-    RuntimeError('dummy',)
+    RuntimeError('dummy')
     >>> propagate(3)
-    ValueError('dummy',)
+    ValueError('dummy')
     >>> propagate(4)
-    TypeError('dummy',)
-    '''
+    TypeError('dummy')
+    """
     try:
         foo(i)
     except Exception as e:
-        print repr(e)
+        print '%s(%r)' % (e.__class__.__name__, e.args[0])
     else:
-        print 'Exception sublass not raised'
+        print 'Exception subclass not raised'