mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Import fixes for the setup package
This commit is contained in:
parent
cc9a11fba0
commit
5bdb5b7c6c
@ -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"
|
||||||
|
@ -11,10 +11,13 @@ import sys
|
|||||||
import tarfile
|
import tarfile
|
||||||
import time
|
import time
|
||||||
|
|
||||||
try:
|
if sys.version_info.major > 2:
|
||||||
import _winreg as winreg
|
|
||||||
except ImportError:
|
|
||||||
import winreg
|
import winreg
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
import _winreg as winreg
|
||||||
|
except ImportError:
|
||||||
|
import winreg
|
||||||
is64bit = os.environ.get('PLATFORM') != 'x86'
|
is64bit = os.environ.get('PLATFORM') != 'x86'
|
||||||
|
|
||||||
|
|
||||||
|
13
src/polyglot/http_server.py
Normal file
13
src/polyglot/http_server.py
Normal 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
|
Loading…
x
Reference in New Issue
Block a user