|
|
ec2a0f |
From 8a3c2c816d789639b49d3ae867213393ed7abdff Mon Sep 17 00:00:00 2001
|
|
|
ec2a0f |
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
|
|
ec2a0f |
Date: Fri, 15 Jul 2022 16:11:37 +0200
|
|
|
ec2a0f |
Subject: [PATCH] Adjust tests for a last minute Python 3.11 change in the
|
|
|
ec2a0f |
traceback format
|
|
|
ec2a0f |
|
|
|
ec2a0f |
See https://github.com/python/cpython/issues/93883
|
|
|
ec2a0f |
and https://github.com/python/cpython/pull/93994
|
|
|
ec2a0f |
|
|
|
ec2a0f |
--HG--
|
|
|
ec2a0f |
branch : python3.11.0b4
|
|
|
ec2a0f |
---
|
|
|
ec2a0f |
c/test_c.py | 35 ++---------------------------------
|
|
|
ec2a0f |
1 file changed, 2 insertions(+), 33 deletions(-)
|
|
|
ec2a0f |
|
|
|
ec2a0f |
diff --git a/c/test_c.py b/c/test_c.py
|
|
|
ec2a0f |
index cde83b80..048711c7 100644
|
|
|
ec2a0f |
--- a/c/test_c.py
|
|
|
ec2a0f |
+++ b/c/test_c.py
|
|
|
ec2a0f |
@@ -1342,11 +1342,11 @@ def test_callback_exception():
|
|
|
ec2a0f |
except ImportError:
|
|
|
ec2a0f |
import io as cStringIO # Python 3
|
|
|
ec2a0f |
import linecache
|
|
|
ec2a0f |
- def matches(istr, ipattern, ipattern38, ipattern311):
|
|
|
ec2a0f |
+ def matches(istr, ipattern, ipattern38, ipattern311=None):
|
|
|
ec2a0f |
if sys.version_info >= (3, 8):
|
|
|
ec2a0f |
ipattern = ipattern38
|
|
|
ec2a0f |
if sys.version_info >= (3, 11):
|
|
|
ec2a0f |
- ipattern = ipattern311
|
|
|
ec2a0f |
+ ipattern = ipattern311 or ipattern38
|
|
|
ec2a0f |
str, pattern = istr, ipattern
|
|
|
ec2a0f |
while '$' in pattern:
|
|
|
ec2a0f |
i = pattern.index('$')
|
|
|
ec2a0f |
@@ -1400,16 +1400,6 @@ Traceback (most recent call last):
|
|
|
ec2a0f |
File "$", line $, in check_value
|
|
|
ec2a0f |
$
|
|
|
ec2a0f |
ValueError: 42
|
|
|
ec2a0f |
-""", """\
|
|
|
ec2a0f |
-Exception ignored from cffi callback <function$Zcb1 at 0x$>:
|
|
|
ec2a0f |
-Traceback (most recent call last):
|
|
|
ec2a0f |
- File "$", line $, in Zcb1
|
|
|
ec2a0f |
- $
|
|
|
ec2a0f |
- $
|
|
|
ec2a0f |
- File "$", line $, in check_value
|
|
|
ec2a0f |
- $
|
|
|
ec2a0f |
- $
|
|
|
ec2a0f |
-ValueError: 42
|
|
|
ec2a0f |
""")
|
|
|
ec2a0f |
sys.stderr = cStringIO.StringIO()
|
|
|
ec2a0f |
bigvalue = 20000
|
|
|
ec2a0f |
@@ -1424,13 +1414,6 @@ Traceback (most recent call last):
|
|
|
ec2a0f |
File "$", line $, in test_callback_exception
|
|
|
ec2a0f |
$
|
|
|
ec2a0f |
OverflowError: integer 60000 does not fit 'short'
|
|
|
ec2a0f |
-""", """\
|
|
|
ec2a0f |
-Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C:
|
|
|
ec2a0f |
-Traceback (most recent call last):
|
|
|
ec2a0f |
- File "$", line $, in test_callback_exception
|
|
|
ec2a0f |
- $
|
|
|
ec2a0f |
- $
|
|
|
ec2a0f |
-OverflowError: integer 60000 does not fit 'short'
|
|
|
ec2a0f |
""")
|
|
|
ec2a0f |
sys.stderr = cStringIO.StringIO()
|
|
|
ec2a0f |
bigvalue = 20000
|
|
|
ec2a0f |
@@ -1479,19 +1462,6 @@ Traceback (most recent call last):
|
|
|
ec2a0f |
File "$", line $, in test_callback_exception
|
|
|
ec2a0f |
$
|
|
|
ec2a0f |
TypeError: $integer$
|
|
|
ec2a0f |
-""", """\
|
|
|
ec2a0f |
-Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert the result back to C:
|
|
|
ec2a0f |
-Traceback (most recent call last):
|
|
|
ec2a0f |
- File "$", line $, in test_callback_exception
|
|
|
ec2a0f |
- $
|
|
|
ec2a0f |
- $
|
|
|
ec2a0f |
-OverflowError: integer 60000 does not fit 'short'
|
|
|
ec2a0f |
-Exception ignored during handling of the above exception by 'onerror':
|
|
|
ec2a0f |
-Traceback (most recent call last):
|
|
|
ec2a0f |
- File "$", line $, in test_callback_exception
|
|
|
ec2a0f |
- $
|
|
|
ec2a0f |
- $
|
|
|
ec2a0f |
-TypeError: $integer$
|
|
|
ec2a0f |
""")
|
|
|
ec2a0f |
#
|
|
|
ec2a0f |
sys.stderr = cStringIO.StringIO()
|
|
|
ec2a0f |
@@ -1526,7 +1496,6 @@ Exception ignored from cffi callback <function$Zcb1 at 0x$>, trying to convert t
|
|
|
ec2a0f |
Traceback (most recent call last):
|
|
|
ec2a0f |
File "$", line $, in test_callback_exception
|
|
|
ec2a0f |
$
|
|
|
ec2a0f |
- $
|
|
|
ec2a0f |
OverflowError: integer 60000 does not fit 'short'
|
|
|
ec2a0f |
Exception ignored during handling of the above exception by 'onerror':
|
|
|
ec2a0f |
Traceback (most recent call last):
|
|
|
ec2a0f |
--
|
|
|
ec2a0f |
GitLab
|
|
|
ec2a0f |
|