[Python-checkins] r46036 - python/trunk/Lib/cookielib.py python/trunk/Lib/urllib2.py

neal.norwitz python-checkins at python.org
Thu May 18 08:51:47 CEST 2006


Author: neal.norwitz
Date: Thu May 18 08:51:46 2006
New Revision: 46036

Modified:
   python/trunk/Lib/cookielib.py
   python/trunk/Lib/urllib2.py
Log:
Little cleanup

Modified: python/trunk/Lib/cookielib.py
==============================================================================
--- python/trunk/Lib/cookielib.py	(original)
+++ python/trunk/Lib/cookielib.py	Thu May 18 08:51:46 2006
@@ -36,13 +36,13 @@
 import httplib  # only for the default HTTP port
 from calendar import timegm
 
-debug = 0   # set to true to enable debugging via the logging module
+debug = False   # set to True to enable debugging via the logging module
 logger = None
 
 def _debug(*args):
-    global logger
     if not debug:
         return
+    global logger
     if not logger:
         import logging
         logger = logging.getLogger("cookielib")

Modified: python/trunk/Lib/urllib2.py
==============================================================================
--- python/trunk/Lib/urllib2.py	(original)
+++ python/trunk/Lib/urllib2.py	Thu May 18 08:51:46 2006
@@ -165,7 +165,7 @@
     pass
 
 # copied from cookielib.py
-cut_port_re = re.compile(r":\d+$")
+_cut_port_re = re.compile(r":\d+$")
 def request_host(request):
     """Return request-host, as defined by RFC 2965.
 
@@ -179,7 +179,7 @@
         host = request.get_header("Host", "")
 
     # remove port, if present
-    host = cut_port_re.sub("", host, 1)
+    host = _cut_port_re.sub("", host, 1)
     return host.lower()
 
 class Request:


More information about the Python-checkins mailing list