mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Correct import of socketserver on Python 3
This commit is contained in:
parent
42b205d75c
commit
1c96d8c933
1 changed files with 5 additions and 2 deletions
|
|
@ -3,7 +3,10 @@ import fabric.contrib.project as project
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import SocketServer
|
try:
|
||||||
|
import socketserver
|
||||||
|
except ImportError:
|
||||||
|
import SocketServer as socketserver
|
||||||
|
|
||||||
from pelican.server import ComplexHTTPRequestHandler
|
from pelican.server import ComplexHTTPRequestHandler
|
||||||
|
|
||||||
|
|
@ -48,7 +51,7 @@ def serve():
|
||||||
"""Serve site at http://localhost:8000/"""
|
"""Serve site at http://localhost:8000/"""
|
||||||
os.chdir(env.deploy_path)
|
os.chdir(env.deploy_path)
|
||||||
|
|
||||||
class AddressReuseTCPServer(SocketServer.TCPServer):
|
class AddressReuseTCPServer(socketserver.TCPServer):
|
||||||
allow_reuse_address = True
|
allow_reuse_address = True
|
||||||
|
|
||||||
server = AddressReuseTCPServer(('', PORT), ComplexHTTPRequestHandler)
|
server = AddressReuseTCPServer(('', PORT), ComplexHTTPRequestHandler)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue