mirror of
https://github.com/certbot/certbot.git
synced 2026-06-04 22:33:00 -04:00
Make simple_http_server.py work on Python 3.
This commit is contained in:
parent
400e605760
commit
ba7a2ab9f0
1 changed files with 6 additions and 3 deletions
|
|
@ -1,8 +1,11 @@
|
|||
#!/usr/bin/env python
|
||||
"""A version of Python 2.x's SimpleHTTPServer that flushes its output."""
|
||||
from BaseHTTPServer import HTTPServer
|
||||
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||
"""A version of Python's SimpleHTTPServer that flushes its output."""
|
||||
import sys
|
||||
try:
|
||||
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||
except ImportError:
|
||||
from BaseHTTPServer import HTTPServer
|
||||
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||
|
||||
def serve_forever(port=0):
|
||||
"""Spins up an HTTP server on all interfaces and the given port.
|
||||
|
|
|
|||
Loading…
Reference in a new issue