Blame SOURCES/113.patch

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