diff --git a/9b8da4b1e2bdc025b643f2061aa32bf7ae0c78a8.patch b/9b8da4b1e2bdc025b643f2061aa32bf7ae0c78a8.patch new file mode 100644 index 0000000..a757da3 --- /dev/null +++ b/9b8da4b1e2bdc025b643f2061aa32bf7ae0c78a8.patch @@ -0,0 +1,38 @@ +From 9b8da4b1e2bdc025b643f2061aa32bf7ae0c78a8 Mon Sep 17 00:00:00 2001 +From: Mike Bayer +Date: Sat, 9 Apr 2022 11:43:32 -0400 +Subject: [PATCH] reduce exception message tested for py311 compat + +Change-Id: I519d4a840fd456ea042a5b0735da183a1e340aa4 +--- + test/test_exceptions.py | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/test/test_exceptions.py b/test/test_exceptions.py +index b1930c5..7a2e6b0 100644 +--- a/test/test_exceptions.py ++++ b/test/test_exceptions.py +@@ -274,10 +274,7 @@ def test_tback_no_trace_from_py_file(self): + html_error = exceptions.html_error_template().render_unicode( + error=v, traceback=None + ) +- assert ( +- "local variable 'y' referenced before assignment" +- in html_error +- ) ++ assert "local variable 'y'" in html_error + + def test_tback_trace_from_py_file(self): + t = self._file_template("runtimeerr.html") +@@ -287,10 +284,7 @@ def test_tback_trace_from_py_file(self): + except: + html_error = exceptions.html_error_template().render_unicode() + +- assert ( +- "local variable 'y' referenced before assignment" +- in html_error +- ) ++ assert "local variable 'y'" in html_error + + def test_code_block_line_number(self): + l = TemplateLookup() diff --git a/python-mako.spec b/python-mako.spec index 3e1e3d7..7561217 100644 --- a/python-mako.spec +++ b/python-mako.spec @@ -9,6 +9,9 @@ Summary: Mako template library for Python URL: http://www.makotemplates.org/ Source0: https://github.com/sqlalchemy/mako/archive/rel_%(echo %{version} | sed "s/\./_/g").tar.gz +# patch for Python 3.11 compatibility to reduce exception message +Patch: https://github.com/sqlalchemy/mako/commit/9b8da4b1e2bdc025b643f2061aa32bf7ae0c78a8.patch + BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: python3-setuptools