diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-05-09 15:49:24 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-05-09 15:49:24 (GMT) |
commit | 78cae61ad47f70208468a77d665b009601fac2be (patch) | |
tree | 6db47727da856dc329b7646b1d895e5a6e3a10b5 | |
parent | caa79a9ee4b738bfa0295dcdbd67dfd2b48a1efd (diff) | |
download | cpython-78cae61ad47f70208468a77d665b009601fac2be.zip cpython-78cae61ad47f70208468a77d665b009601fac2be.tar.gz cpython-78cae61ad47f70208468a77d665b009601fac2be.tar.bz2 |
Raise useful exception when called with URL for which request type
cannot be determined.
Pseudo-fix for SF bug #420724
-rw-r--r-- | Lib/urllib2.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 042f2ba..992c83b 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -217,7 +217,8 @@ class Request: def get_type(self): if self.type is None: self.type, self.__r_type = splittype(self.__original) - assert self.type is not None, self.__original + if self.type is None: + raise ValueError, "unknown url type: %s" % self.__original return self.type def get_host(self): |