Import fixes for the setup package

This commit is contained in:
Kovid Goyal 2018-09-10 20:44:16 +05:30
parent cc9a11fba0
commit 5bdb5b7c6c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 20 additions and 5 deletions

View File

@ -241,8 +241,7 @@ class Manual(Command):
def serve_manual(self, root):
os.chdir(root)
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
from polyglot.http_server import BaseHTTPServer, SimpleHTTPRequestHandler
HandlerClass = SimpleHTTPRequestHandler
ServerClass = BaseHTTPServer.HTTPServer
Protocol = "HTTP/1.0"

View File

@ -11,6 +11,9 @@ import sys
import tarfile
import time
if sys.version_info.major > 2:
import winreg
else:
try:
import _winreg as winreg
except ImportError:

View File

@ -0,0 +1,13 @@
#!/usr/bin/env python2
# vim:fileencoding=utf-8
# License: GPL v3 Copyright: 2018, Kovid Goyal <kovid at kovidgoyal.net>
from __future__ import absolute_import, division, print_function, unicode_literals
from polyglot.builtins import is_py3
if is_py3:
from http.server import BaseHTTPServer, SimpleHTTPRequestHandler
else:
import BaseHTTPServer # noqa
from SimpleHTTPServer import SimpleHTTPRequestHandler # noqa