Blame SOURCES/113.patch

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