Skip to content

Commit 263a752

Browse files
Fix cgi import in wptserve.
Differential Revision: https://phabricator.services.mozilla.com/D240615 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1952230 gecko-commit: 211369cf947812cdc1b1f76260bf2106af0dca7f
1 parent d7c4f71 commit 263a752

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Diff for: tools/wptserve/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
author_email='[email protected]',
2020
url='http://wptserve.readthedocs.org/',
2121
license='BSD',
22-
packages=['wptserve', 'wptserve.sslutils'],
22+
packages=['wptserve', 'wptserve.sslutils', 'wptserve.cgi'],
2323
include_package_data=True,
2424
zip_safe=False,
2525
install_requires=deps

Diff for: tools/wptserve/wptserve/request.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from urllib.parse import parse_qsl, urlsplit
1010

1111
from . import stash
12-
from . import cgi
12+
from .cgi import FieldStorage
1313
from .utils import HTTPException, isomorphic_encode, isomorphic_decode
1414

1515
KT = TypeVar('KT')
@@ -348,7 +348,7 @@ def POST(self):
348348
"keep_blank_values": True,
349349
"encoding": "iso-8859-1",
350350
}
351-
fs = cgi.FieldStorage(**kwargs)
351+
fs = FieldStorage(**kwargs)
352352
self._POST = MultiDict.from_field_storage(fs)
353353
self.raw_input.seek(pos)
354354
return self._POST
@@ -612,7 +612,7 @@ def get_list(self, key):
612612

613613
@classmethod
614614
def from_field_storage(cls, fs):
615-
"""Construct a MultiDict from a cgi.FieldStorage
615+
"""Construct a MultiDict from a FieldStorage
616616
617617
Note that all keys and values are binary strings.
618618
"""
@@ -628,7 +628,7 @@ def from_field_storage(cls, fs):
628628
if not value.filename:
629629
value = isomorphic_encode(value.value)
630630
else:
631-
assert isinstance(value, cgi.FieldStorage)
631+
assert isinstance(value, FieldStorage)
632632
self.add(isomorphic_encode(key), value)
633633
return self
634634

0 commit comments

Comments
 (0)