mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Remove six.PY2 and platform checks and add warning
After a discussion with Joshua Lock, we agreed that for
Windows users it would be good to provide the option to use
SimpleHTTPRequestHandler, but still leave a warning about it,
knowing that this caused an error before.
See: 7dbb30ae10
Signed-off-by: Martin Vrachev <mvrachev@vmware.com>
This commit is contained in:
parent
b42ca297e5
commit
c7f878b2dc
1 changed files with 11 additions and 12 deletions
|
|
@ -66,20 +66,19 @@ def log_request(self, code='-', size='-'):
|
|||
|
||||
# NOTE: On Windows/Python2 tests that use this simple_server.py in a
|
||||
# subprocesses hang after a certain amount of requests (~68), if a PIPE is
|
||||
# passed as Popen's stderr argument. As a simple workaround we silence the
|
||||
# server on those Windows/Py2 to not fill the buffer.
|
||||
if six.PY2 and platform.system() == 'Windows':
|
||||
# passed as Popen's stderr argument. This problem doesn't emerge if
|
||||
# we silence the HTTP messages.
|
||||
# If you decide to receive the HTTP messages, then this bug
|
||||
# could reappear.
|
||||
use_quiet_http_request_handler = True
|
||||
|
||||
if len(sys.argv) > 2:
|
||||
use_quiet_http_request_handler = sys.argv[2]
|
||||
|
||||
if use_quiet_http_request_handler:
|
||||
handler = QuietHTTPRequestHandler
|
||||
else:
|
||||
use_quiet_http_request_handler = True
|
||||
|
||||
if len(sys.argv) > 2:
|
||||
use_quiet_http_request_handler = sys.argv[2]
|
||||
|
||||
if use_quiet_http_request_handler:
|
||||
handler = QuietHTTPRequestHandler
|
||||
else:
|
||||
handler = SimpleHTTPRequestHandler
|
||||
handler = SimpleHTTPRequestHandler
|
||||
|
||||
httpd = six.moves.socketserver.TCPServer(('', PORT), handler)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue