summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-06-02 03:04:52 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-06-02 03:04:52 (GMT)
commit10ff706e2788a7c7ef9f8ea0108a5ede625fedad (patch)
treed2c08c7f262865884912dc04dd05b36656646851 /Lib/urllib.py
parentf13eb55d59d80907c9f86574ddd23bce2cb41ff3 (diff)
downloadcpython-10ff706e2788a7c7ef9f8ea0108a5ede625fedad.zip
cpython-10ff706e2788a7c7ef9f8ea0108a5ede625fedad.tar.gz
cpython-10ff706e2788a7c7ef9f8ea0108a5ede625fedad.tar.bz2
Replaced boolean tests with is None.
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index b248b8a..0720125 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -203,7 +203,7 @@ class URLopener:
if self.tempcache and url in self.tempcache:
return self.tempcache[url]
type, url1 = splittype(url)
- if not filename and (not type or type == 'file'):
+ if filename is None and (not type or type == 'file'):
try:
fp = self.open_local_file(url1)
hdrs = fp.info()
@@ -662,7 +662,7 @@ _localhost = None
def localhost():
"""Return the IP address of the magic hostname 'localhost'."""
global _localhost
- if not _localhost:
+ if _localhost is None:
_localhost = socket.gethostbyname('localhost')
return _localhost
@@ -670,7 +670,7 @@ _thishost = None
def thishost():
"""Return the IP address of the current host."""
global _thishost
- if not _thishost:
+ if _thishost is None:
_thishost = socket.gethostbyname(socket.gethostname())
return _thishost
@@ -678,7 +678,7 @@ _ftperrors = None
def ftperrors():
"""Return the set of errors raised by the FTP class."""
global _ftperrors
- if not _ftperrors:
+ if _ftperrors is None:
import ftplib
_ftperrors = ftplib.all_errors
return _ftperrors
@@ -687,7 +687,7 @@ _noheaders = None
def noheaders():
"""Return an empty mimetools.Message object."""
global _noheaders
- if not _noheaders:
+ if _noheaders is None:
import mimetools
import StringIO
_noheaders = mimetools.Message(StringIO.StringIO(), 0)