]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
admin/serve-doc: Switch to python3 only 33596/head
authorBrad Hubbard <bhubbard@redhat.com>
Fri, 28 Feb 2020 05:25:17 +0000 (15:25 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Sat, 29 Feb 2020 00:29:21 +0000 (10:29 +1000)
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
admin/serve-doc

index 96da048e58713224357d6d5cdae5c0ada51a3ce6..fa2805938208a017b0d4f04bc0d3336ba590ee08 100755 (executable)
@@ -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,
     )