Commit d1401233 authored by Stefan Behnel's avatar Stefan Behnel

fix new memory view error test in Py2.4

parent 8164bb31
# mode: run # mode: run
# tag: memoryview
cdef double[:] foo(int i): cdef double[:] foo(int i):
if i == 1: if i == 1:
...@@ -10,22 +12,23 @@ cdef double[:] foo(int i): ...@@ -10,22 +12,23 @@ cdef double[:] foo(int i):
if i == 4: if i == 4:
raise TypeError('dummy') raise TypeError('dummy')
def propagate(i): def propagate(i):
''' """
>>> propagate(0) >>> propagate(0)
TypeError('Memoryview return value is not initialized',) TypeError('Memoryview return value is not initialized')
>>> propagate(1) >>> propagate(1)
AttributeError('dummy',) AttributeError('dummy')
>>> propagate(2) >>> propagate(2)
RuntimeError('dummy',) RuntimeError('dummy')
>>> propagate(3) >>> propagate(3)
ValueError('dummy',) ValueError('dummy')
>>> propagate(4) >>> propagate(4)
TypeError('dummy',) TypeError('dummy')
''' """
try: try:
foo(i) foo(i)
except Exception as e: except Exception as e:
print repr(e) print '%s(%r)' % (e.__class__.__name__, e.args[0])
else: else:
print 'Exception sublass not raised' print 'Exception subclass not raised'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment