From dcf1b184849b6de513ef0dc5c7942841094bc583 Mon Sep 17 00:00:00 2001 From: Martin Majlis Date: Wed, 21 Feb 2024 21:38:20 +0100 Subject: [PATCH] Fix issue found by CodeQL - Inefficient regular expression --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d09a4b0..1c58319 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,9 @@ def fix_doc(txt): """ Fixes documentation so that it's readable in pypi website. """ - return re.sub(r"\.\. PYPI-BEGIN([\r\n]|.)*?PYPI-END", "", txt, flags=re.DOTALL) + return re.sub( + r"\.\. PYPI-BEGIN([\r\n]|[^\r\n])*?PYPI-END", "", txt, flags=re.DOTALL + ) with open("README.rst", encoding="utf8") as fileR: