diff --git a/0001-tests-test_ansi2html.py-use-sys.executable-instead-o.patch b/0001-tests-test_ansi2html.py-use-sys.executable-instead-o.patch
new file mode 100644
index 0000000..e962dc6
--- /dev/null
+++ b/0001-tests-test_ansi2html.py-use-sys.executable-instead-o.patch
@@ -0,0 +1,33 @@
+From 01aa299300788591e91dd7290c455240056607a0 Mon Sep 17 00:00:00 2001
+From: Johannes Kastl
+Date: Tue, 9 May 2023 14:00:51 +0200
+Subject: [PATCH] tests/test_ansi2html.py: use sys.executable instead of
+ hardcoded python3
+
+Signed-off-by: Johannes Kastl
+---
+ tests/test_ansi2html.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test_ansi2html.py b/tests/test_ansi2html.py
+index 04b5d22..2e88a8f 100644
+--- a/tests/test_ansi2html.py
++++ b/tests/test_ansi2html.py
+@@ -22,6 +22,7 @@
+ # .
+
+ import textwrap
++import sys
+ from io import StringIO
+ from os.path import abspath, dirname, join
+ from subprocess import PIPE, Popen, run
+@@ -499,5 +500,5 @@ class TestAnsi2HTML:
+ assert process.returncode == 0
+
+ def test_command_module(self) -> None:
+- result = run(["python3", "-m", "ansi2html", "--version"], check=True)
++ result = run([sys.executable, "-m", "ansi2html", "--version"], check=True)
+ assert result.returncode == 0
+--
+2.40.1
+
diff --git a/python-ansi2html.changes b/python-ansi2html.changes
index 2731928..22d9b33 100644
--- a/python-ansi2html.changes
+++ b/python-ansi2html.changes
@@ -1,3 +1,17 @@
+-------------------------------------------------------------------
+Tue May 9 12:02:38 UTC 2023 - Johannes Kastl
+
+- add patch
+ 0001-tests-test_ansi2html.py-use-sys.executable-instead-o.patch
+ to replace a hardcoded 'python3' in a test (which leads to errors
+ on SLES15 with python3.11)
+ https://github.com/pycontribs/ansi2html/issues/210
+
+-------------------------------------------------------------------
+Tue May 9 11:20:43 UTC 2023 - Johannes Kastl
+
+- add sle15_python_module_pythons
+
-------------------------------------------------------------------
Thu Aug 4 08:46:29 UTC 2022 - Otto Hollmann
diff --git a/python-ansi2html.spec b/python-ansi2html.spec
index c75bdb7..b8c4818 100644
--- a/python-ansi2html.spec
+++ b/python-ansi2html.spec
@@ -1,7 +1,7 @@
#
# spec file for package python-ansi2html
#
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,7 +16,7 @@
#
-%{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%{?sle15_python_module_pythons}
Name: python-ansi2html
Version: 1.8.0
Release: 0
@@ -25,6 +25,10 @@ License: LGPL-3.0-or-later
Group: Development/Languages/Python
URL: https://github.com/ralphbean/ansi2html/
Source: https://github.com/ralphbean/ansi2html/archive/%{version}.tar.gz
+# PATCH-FIX-UPSTREAM
+# 0001-tests-test_ansi2html.py-use-sys.executable-instead-o.patch
+# gh#pycontribs/ansi2html#210 kastl@b1-systems.de
+Patch0: 0001-tests-test_ansi2html.py-use-sys.executable-instead-o.patch
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
@@ -42,6 +46,7 @@ A module to convert text with ANSI color codes to HTML or to LaTeX.
%prep
%setup -q -n ansi2html-%{version}
+%patch0 -p1
%build
%pyproject_wheel