summaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorMatt Davis <mrd@redhat.com>2022-02-01 12:43:18 -0800
committerMatt Davis <mrd@redhat.com>2022-02-01 12:43:18 -0800
commitc5f8e99eb87818859f93ae7dab9ca3fe36378436 (patch)
treef728e95f6556feecf9154b8f339f134b0335347b /c
parentdc406efc754c723991ec93f71cdf5d4d5d968f7b (diff)
parent6508642d5869998c72578e54dad3694dfe4cdb45 (diff)
downloadcffi-c5f8e99eb87818859f93ae7dab9ca3fe36378436.tar.gz
update from default
Diffstat (limited to 'c')
-rw-r--r--c/test_c.py47
1 files changed, 46 insertions, 1 deletions
diff --git a/c/test_c.py b/c/test_c.py
index 654584d..906eb07 100644
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -1331,9 +1331,11 @@ def test_callback_exception():
except ImportError:
import io as cStringIO # Python 3
import linecache
- def matches(istr, ipattern, ipattern38):
+ def matches(istr, ipattern, ipattern38, ipattern311):
if sys.version_info >= (3, 8):
ipattern = ipattern38
+ if sys.version_info >= (3, 11):
+ ipattern = ipattern311
str, pattern = istr, ipattern
while '$' in pattern:
i = pattern.index('$')
@@ -1387,6 +1389,16 @@ Traceback (most recent call last):
File "$", line $, in check_value
$
ValueError: 42
+""", """\
+Exception ignored from cffi callback <function$Zcb1 at 0x$>:
+Traceback (most recent call last):
+ File "$", line $, in Zcb1
+ $
+ $
+ File "$", line $, in check_value
+ $
+ $
+ValueError: 42
""")
sys.stderr = cStringIO.StringIO()
bigvalue = 20000
@@ -1401,6 +1413,13 @@ Traceback (most recent call last):
File "$", line $, in test_callback_exception
$
OverflowError: integer 60000 does not fit 'short'
+""", """\
+Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C:
+Traceback (most recent call last):
+ File "$", line $, in test_callback_exception
+ $
+ $
+OverflowError: integer 60000 does not fit 'short'
""")
sys.stderr = cStringIO.StringIO()
bigvalue = 20000
@@ -1449,6 +1468,19 @@ Traceback (most recent call last):
File "$", line $, in test_callback_exception
$
TypeError: $integer$
+""", """\
+Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C:
+Traceback (most recent call last):
+ File "$", line $, in test_callback_exception
+ $
+ $
+OverflowError: integer 60000 does not fit 'short'
+Exception ignored during handling of the above exception by 'onerror':
+Traceback (most recent call last):
+ File "$", line $, in test_callback_exception
+ $
+ $
+TypeError: $integer$
""")
#
sys.stderr = cStringIO.StringIO()
@@ -1478,6 +1510,19 @@ Traceback (most recent call last):
File "$", line $, in oops
$
AttributeError: 'str' object has no attribute 'append$
+""", """\
+Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C:
+Traceback (most recent call last):
+ File "$", line $, in test_callback_exception
+ $
+ $
+OverflowError: integer 60000 does not fit 'short'
+Exception ignored during handling of the above exception by 'onerror':
+Traceback (most recent call last):
+ File "$", line $, in oops
+ $
+ $
+AttributeError: 'str' object has no attribute 'append$
""")
finally:
sys.stderr = orig_stderr