1
0
Fork 0
forked from github/pelican

Correct import of socketserver on Python 3

This commit is contained in:
Jonas Lundholm Bertelsen 2017-07-24 12:25:21 +02:00
commit 1c96d8c933

View file

@ -3,7 +3,10 @@ import fabric.contrib.project as project
import os
import shutil
import sys
import SocketServer
try:
import socketserver
except ImportError:
import SocketServer as socketserver
from pelican.server import ComplexHTTPRequestHandler
@ -48,7 +51,7 @@ def serve():
"""Serve site at http://localhost:8000/"""
os.chdir(env.deploy_path)
class AddressReuseTCPServer(SocketServer.TCPServer):
class AddressReuseTCPServer(socketserver.TCPServer):
allow_reuse_address = True
server = AddressReuseTCPServer(('', PORT), ComplexHTTPRequestHandler)