From 40b2ebff8f48ca2b74a1308c47059a44325da555 Mon Sep 17 00:00:00 2001 From: Chris Mayo Date: Wed, 5 Aug 2020 19:54:56 +0100 Subject: [PATCH] Remove defaults from lc_cgi.checklink() Only called from application() with arguments. Causes local environment to be embedded in documentation when using Sphinx autodoc. --- linkcheck/lc_cgi.py | 3 +-- tests/test_cgi.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/linkcheck/lc_cgi.py b/linkcheck/lc_cgi.py index 6b6857d4..fcc24117 100644 --- a/linkcheck/lc_cgi.py +++ b/linkcheck/lc_cgi.py @@ -18,7 +18,6 @@ Functions used by the WSGI script. """ import html -import os import threading import locale import re @@ -137,7 +136,7 @@ def encode(s): return s.encode(HTML_ENCODING, 'ignore') -def checklink(form=None, env=os.environ): +def checklink(form, env): """Validates the CGI form and checks the given links.""" if form is None: form = {} diff --git a/tests/test_cgi.py b/tests/test_cgi.py index 0c01bf40..dde66ffa 100644 --- a/tests/test_cgi.py +++ b/tests/test_cgi.py @@ -53,7 +53,7 @@ class TestWsgi(unittest.TestCase): def test_checklink(self): form = dict(url="http://www.example.com/", level="0") - checklink(form) + checklink(form, {}) def test_application(self): form = dict(url="http://www.example.com/", level="0")