summaryrefslogtreecommitdiffstats
path: root/Lib/urllib2.py
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2006-02-18 04:14:16 (GMT)
committerTim Peters <tim.peters@gmail.com>2006-02-18 04:14:16 (GMT)
commite2c9a6cea7f49cc7485ced3ed907c917e3ad656a (patch)
tree6d28acef9625c2075be879361341c90fe62d8205 /Lib/urllib2.py
parent24f7cad6ca3140bf0dada04261cb372be658832e (diff)
downloadcpython-e2c9a6cea7f49cc7485ced3ed907c917e3ad656a.zip
cpython-e2c9a6cea7f49cc7485ced3ed907c917e3ad656a.tar.gz
cpython-e2c9a6cea7f49cc7485ced3ed907c917e3ad656a.tar.bz2
Suppress new deprecation warnings when running the
test suite. For urllib2, move the import of gopherlib into the only function that uses it: users (including the test suite) certainly shouldn't see a deprecation warning just because they import urllib2! If they actually use gopher_open(), fine, _then_ they should see a deprecation warning.
Diffstat (limited to 'Lib/urllib2.py')
-rw-r--r--Lib/urllib2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py
index 19bf082..4c83bfc 100644
--- a/Lib/urllib2.py
+++ b/Lib/urllib2.py
@@ -89,7 +89,6 @@ f = urllib2.urlopen('http://www.python.org/')
import base64
import ftplib
-import gopherlib
import httplib
import inspect
import md5
@@ -1259,6 +1258,7 @@ class CacheFTPHandler(FTPHandler):
class GopherHandler(BaseHandler):
def gopher_open(self, req):
+ import gopherlib # this raises DeprecationWarning in 2.5
host = req.get_host()
if not host:
raise GopherError('no host given')