mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Raise useful exception when called with URL for which request type
cannot be determined. Pseudo-fix for SF bug #420724
This commit is contained in:
parent
caa79a9ee4
commit
78cae61ad4
1 changed files with 2 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue