From: Brad Hubbard Date: Fri, 28 Feb 2020 05:25:17 +0000 (+1000) Subject: admin/serve-doc: Switch to python3 only X-Git-Tag: v15.1.1~198^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F33596%2Fhead;p=ceph.git admin/serve-doc: Switch to python3 only Signed-off-by: Brad Hubbard --- diff --git a/admin/serve-doc b/admin/serve-doc index 96da048e5871..fa2805938208 100755 --- a/admin/serve-doc +++ b/admin/serve-doc @@ -1,8 +1,9 @@ -#!/usr/bin/python +#!/usr/bin/python3 + from __future__ import print_function -import SimpleHTTPServer -import SocketServer +import http.server +import socketserver import os import sys @@ -11,7 +12,7 @@ os.chdir(path) os.chdir('..') os.chdir('build-doc/output/html') -class ReusingTCPServer(SimpleHTTPServer.SimpleHTTPRequestHandler): +class ReusingTCPServer(http.server.SimpleHTTPRequestHandler): allow_reuse_address = True def send_head(self): @@ -19,9 +20,9 @@ class ReusingTCPServer(SimpleHTTPServer.SimpleHTTPRequestHandler): # slash-redirecting of requests with query arguments, and will # redirect to /foo?q=bar/ -- wrong slash placement self.path = self.path.split('?', 1)[0] - return SimpleHTTPServer.SimpleHTTPRequestHandler.send_head(self) + return http.server.SimpleHTTPRequestHandler.send_head(self) -httpd = SocketServer.TCPServer( +httpd = socketserver.TCPServer( ("", 8080), ReusingTCPServer, )