From b678ce5aa67d890bb080df19fa35a232a19dac65 Mon Sep 17 00:00:00 2001
From: Neal Norwitz <nnorwitz@gmail.com>
Date: Thu, 18 May 2006 06:51:46 +0000
Subject: Little cleanup

---
 Lib/cookielib.py | 4 ++--
 Lib/urllib2.py   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Lib/cookielib.py b/Lib/cookielib.py
index 808eca6..e8fee0e 100644
--- a/Lib/cookielib.py
+++ b/Lib/cookielib.py
@@ -36,13 +36,13 @@ except ImportError:
 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")
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index 990955a..cdb3a22 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -165,7 +165,7 @@ class GopherError(URLError):
     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 @@ def request_host(request):
         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:
-- 
cgit v0.12

