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): def serve_manual(self, root):
os.chdir(root) os.chdir(root)
import BaseHTTPServer from polyglot.http_server import BaseHTTPServer, SimpleHTTPRequestHandler
from SimpleHTTPServer import SimpleHTTPRequestHandler
HandlerClass = SimpleHTTPRequestHandler HandlerClass = SimpleHTTPRequestHandler
ServerClass = BaseHTTPServer.HTTPServer ServerClass = BaseHTTPServer.HTTPServer
Protocol = "HTTP/1.0" Protocol = "HTTP/1.0"

View File

@ -11,9 +11,12 @@ import sys
import tarfile import tarfile
import time import time
try: if sys.version_info.major > 2:
import winreg
else:
try:
import _winreg as winreg import _winreg as winreg
except ImportError: except ImportError:
import winreg import winreg
is64bit = os.environ.get('PLATFORM') != 'x86' is64bit = os.environ.get('PLATFORM') != 'x86'

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