Blame SOURCES/113.patch

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