mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Switch wsgiref to io.{StringIO,BytesIO}. This shuts up the test failures.
(I'm not sure about it actually working though.)
This commit is contained in:
parent
0269b91030
commit
6a10e02aa6
3 changed files with 5 additions and 5 deletions
|
@ -7,7 +7,7 @@ from wsgiref import util
|
|||
from wsgiref.validate import validator
|
||||
from wsgiref.simple_server import WSGIServer, WSGIRequestHandler, demo_app
|
||||
from wsgiref.simple_server import make_server
|
||||
from StringIO import StringIO
|
||||
from io import StringIO, BytesIO
|
||||
from SocketServer import BaseServer
|
||||
import re, sys
|
||||
|
||||
|
@ -47,9 +47,9 @@ def hello_app(environ,start_response):
|
|||
])
|
||||
return ["Hello, world!"]
|
||||
|
||||
def run_amock(app=hello_app, data="GET / HTTP/1.0\n\n"):
|
||||
def run_amock(app=hello_app, data=b"GET / HTTP/1.0\n\n"):
|
||||
server = make_server("", 80, app, MockServer, MockHandler)
|
||||
inp, out, err, olderr = StringIO(data), StringIO(), StringIO(), sys.stderr
|
||||
inp, out, err, olderr = BytesIO(data), StringIO(), StringIO(), sys.stderr
|
||||
sys.stderr = err
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue