From 344fed0ffd5ccaed20da10fead5b1fb899201f7a Mon Sep 17 00:00:00 2001 From: Jonas Bardino Date: Wed, 11 Mar 2026 18:06:57 +0100 Subject: [PATCH 1/2] Comment-only change to trigger existing lint errors for wsgisupp in relation to vindicating the style changes in PR #481. --- tests/support/wsgisupp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/support/wsgisupp.py b/tests/support/wsgisupp.py index 2451967d1..512bc8a33 100644 --- a/tests/support/wsgisupp.py +++ b/tests/support/wsgisupp.py @@ -3,7 +3,7 @@ # --- BEGIN_HEADER --- # # wsgisupp - test support library for WSGI -# Copyright (C) 2003-2025 The MiG Project by the Science HPC Center at UCPH +# Copyright (C) 2003-2026 The MiG Project by the Science HPC Center at UCPH # # This file is part of MiG. # @@ -19,7 +19,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. # # -- END_HEADER --- # From ec2bc625eafad02dea2a8454e82a6f6b69d07821 Mon Sep 17 00:00:00 2001 From: Jonas Bardino Date: Wed, 11 Mar 2026 22:15:07 +0100 Subject: [PATCH 2/2] Fix lint errors by retiring legacy PY2 imports and add missing self arg to the `_errors` class `close` method. Add missing a couple of docstrings while at it and adjust imports slightly. --- tests/support/wsgisupp.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/support/wsgisupp.py b/tests/support/wsgisupp.py index 512bc8a33..1105d0db8 100644 --- a/tests/support/wsgisupp.py +++ b/tests/support/wsgisupp.py @@ -30,15 +30,9 @@ from collections import namedtuple import codecs from io import BytesIO -from werkzeug.datastructures import MultiDict - -from tests.support._env import PY2 +from urllib.parse import urlencode, urlparse -if PY2: - from urllib import urlencode - from urlparse import urlparse -else: - from urllib.parse import urlencode, urlparse +from werkzeug.datastructures import MultiDict # named type representing the tuple that is passed to WSGI handlers @@ -86,7 +80,10 @@ def create_wsgi_environ(configuration, wsgi_url, method='GET', query=None, heade wsgi_input = () class _errors: - def close(): + """Internal helper to ignore wsgi.errors close method calls""" + + def close(self, *ars, **kwargs): + """"Simply ignore""" pass environ = {}