Patchwork [2,of,4] hgweb: import BaseHTTPServer as module at top level

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 19, 2015, 2:18 p.m.
Message ID <02988a3d85ad846d0c45.1447942735@mimosa>
Download mbox | patch
Permalink /patch/11518/
State Accepted
Headers show

Comments

Yuya Nishihara - Nov. 19, 2015, 2:18 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1446358028 -32400
#      Sun Nov 01 15:07:08 2015 +0900
# Node ID 02988a3d85ad846d0c4594395d3b02fec988565c
# Parent  837a7c46e58c07033990f0b8b85fd537d97757b9
hgweb: import BaseHTTPServer as module at top level

This will avoid future warning spotted by the import checker.

Patch

diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py
--- a/mercurial/hgweb/common.py
+++ b/mercurial/hgweb/common.py
@@ -6,6 +6,7 @@ 
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
+import BaseHTTPServer
 import errno, mimetypes, os
 
 HTTP_OK = 200
@@ -102,8 +103,7 @@  class continuereader(object):
         raise AttributeError
 
 def _statusmessage(code):
-    from BaseHTTPServer import BaseHTTPRequestHandler
-    responses = BaseHTTPRequestHandler.responses
+    responses = BaseHTTPServer.BaseHTTPRequestHandler.responses
     return responses.get(code, ('Error', 'Unknown error'))[0]
 
 def statusmessage(code, message=None):