From: Jeremy Hylton Date: Wed, 9 May 2001 15:49:24 +0000 (+0000) Subject: Raise useful exception when called with URL for which request type X-Git-Tag: v2.2a3~1873 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78cae61ad47f70208468a77d665b009601fac2be;p=thirdparty%2FPython%2Fcpython.git Raise useful exception when called with URL for which request type cannot be determined. Pseudo-fix for SF bug #420724 --- diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 042f2ba6f2c3..992c83b5a1d9 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):