From c3907d33d04923b0b4ad778464cdedae4292cdde Mon Sep 17 00:00:00 2001 From: tzing_t Date: Thu, 14 Nov 2024 03:22:15 +0000 Subject: [PATCH] support python3.11 fix test error --- python-cffi.spec | 6 +++- support_python3.11_fix_test_error.patch | 40 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 support_python3.11_fix_test_error.patch diff --git a/python-cffi.spec b/python-cffi.spec index c81c293..9f88fec 100644 --- a/python-cffi.spec +++ b/python-cffi.spec @@ -6,12 +6,13 @@ based on C-like declarations that you can often copy-paste from header files or Name: python-%{_name} Version: 1.14.6 -Release: 1 +Release: 2 Summary: %{_summary} License: MIT URL: http://cffi.readthedocs.org Source0: https://files.pythonhosted.org/packages/source/c/cffi/%{_name}-%{version}.tar.gz +Patch01: support_python3.11_fix_test_error.patch Buildrequires: gdb libffi-devel gcc-c++ gcc python3-sphinx @@ -52,6 +53,9 @@ PYTHONPATH=%{buildroot}%{python3_sitearch} %{__python3} -m pytest c/ testing/ %doc PKG-INFO README.md %changelog +* Thu Nov 14 2024 tzing_t - 1.14.6-2 +- support python3.11 fix test error + * Sat Jul 24 2021 shixuantong - 1.14.6-1 - upgrade version to 1.14.6 diff --git a/support_python3.11_fix_test_error.patch b/support_python3.11_fix_test_error.patch new file mode 100644 index 0000000..d36aa44 --- /dev/null +++ b/support_python3.11_fix_test_error.patch @@ -0,0 +1,40 @@ +diff --git a/c/test_c.py b/c/test_c.py +index 3d2a23a..5ae776a 100644 +--- a/c/test_c.py ++++ b/c/test_c.py +@@ -1402,6 +1402,7 @@ Exception ignored from cffi callback , trying to convert t + Traceback (most recent call last): + File "$", line $, in test_callback_exception + $ ++ + OverflowError: integer 60000 does not fit 'short' + """) + sys.stderr = cStringIO.StringIO() +@@ -1445,11 +1446,13 @@ Exception ignored from cffi callback , trying to convert t + Traceback (most recent call last): + File "$", line $, in test_callback_exception + $ ++ + OverflowError: integer 60000 does not fit 'short' + Exception ignored during handling of the above exception by 'onerror': + Traceback (most recent call last): + File "$", line $, in test_callback_exception + $ ++ + TypeError: $integer$ + """) + # +@@ -1474,11 +1477,13 @@ Exception ignored from cffi callback , trying to convert t + Traceback (most recent call last): + File "$", line $, in test_callback_exception + $ ++ + OverflowError: integer 60000 does not fit 'short' + Exception ignored during handling of the above exception by 'onerror': + Traceback (most recent call last): + File "$", line $, in oops + $ ++ ^^^^^^^^^^^ + AttributeError: 'str' object has no attribute 'append$ + """) + finally: -- Gitee