mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Replace usage of six.moves.urllib with urllib
Also organize some of the imports. Now that Servo only uses Python 3, this module is unnecessary. This is part of the gradual migration to using only Python 3.
This commit is contained in:
parent
53218621e9
commit
e9942bddb0
10 changed files with 37 additions and 35 deletions
|
@ -14,7 +14,7 @@ import six.moves.BaseHTTPServer
|
|||
import six.moves.SimpleHTTPServer
|
||||
import six.moves.socketserver
|
||||
import threading
|
||||
import six.moves.urllib.parse
|
||||
import urllib
|
||||
import six
|
||||
|
||||
# List of jQuery modules that will be tested.
|
||||
|
@ -149,13 +149,13 @@ def run_http_server():
|
|||
path = self.translate_path(self.path)
|
||||
f = None
|
||||
if os.path.isdir(path):
|
||||
parts = six.moves.urllib.parse.urlsplit(self.path)
|
||||
parts = urllib.parse.urlsplit(self.path)
|
||||
if not parts.path.endswith('/'):
|
||||
# redirect browser - doing basically what apache does
|
||||
self.send_response(301)
|
||||
new_parts = (parts[0], parts[1], parts[2] + '/',
|
||||
parts[3], parts[4])
|
||||
new_url = six.moves.urllib.parse.urlunsplit(new_parts)
|
||||
new_url = urllib.parse.urlunsplit(new_parts)
|
||||
self.send_header("Location", new_url)
|
||||
self.end_headers()
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue