Blame SOURCES/113.patch

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