diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 042f2ba6f2c..992c83b5a1d 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -217,7 +217,8 @@ def get_full_url(self): 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):