Commits

Robert Brewer committed f5ff768

Moved responseCodes to _cputil (DRY).

Comments (0)

Files changed (2)

cherrypy/_cphttptools.py

 
 import cgi
 
-from BaseHTTPServer import BaseHTTPRequestHandler
-responseCodes = BaseHTTPRequestHandler.responses
-
 import Cookie
 import os
 import re
         
         if reason is None:
             try:
-                reason = responseCodes[code][0]
+                reason = _cputil.responseCodes[code][0]
             except (KeyError, IndexError):
                 reason = ""
         

cherrypy/_cputil.py

 import os
 #import os.path
 
+from BaseHTTPServer import BaseHTTPRequestHandler
+responseCodes = BaseHTTPRequestHandler.responses
+
 import cherrypy
 
 class EmptyClass:
     </html>
     ''' % subTuple
 
-import BaseHTTPServer
-_HTTPResponses = BaseHTTPServer.BaseHTTPRequestHandler.responses
-
 def getErrorStatusAndPage(status, traceback = None):
-    statusString, message = _HTTPResponses[status]
+    statusString, message = responseCodes[status]
     statusString = '%d %s' % (status, statusString)
     
     if traceback is None: