Avoid an ImportError when processing the spec file without pygments

This commit is contained in:
Miro Hrončok 2023-01-27 20:21:34 +01:00
parent ee2d6e7fff
commit 7988e82bd7

View File

@ -101,7 +101,7 @@ complex functional testing for applications and libraries.
# To make the tests work with pygments 2.13, we set the added {endline}s to empty.
# Once pygments 2.14+ is omnipresent, feel free to remove this hack,
# but bump the minimal BuildRequired version of python3-pygments to 2.14.
%if v"0%(%{python3} -c "import pygments; print(pygments.__version__)")" < v"2.14~~"
%if v"0%(%{python3} -c "import pygments; print(pygments.__version__)" 2>/dev/null)" < v"2.14~~"
sed -i 's/"endline": "\\x1b\[90m\\x1b\[39;49;00m",/"endline": "",/' testing/conftest.py
%endif