mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Raise statement normalization in Lib/.
This commit is contained in:
parent
8b3febef2f
commit
ce36ad8a46
80 changed files with 502 additions and 530 deletions
|
@ -210,7 +210,7 @@ class Request:
|
|||
if hasattr(Request, 'get_' + name):
|
||||
getattr(self, 'get_' + name)()
|
||||
return getattr(self, attr)
|
||||
raise AttributeError, attr
|
||||
raise AttributeError(attr)
|
||||
|
||||
def get_method(self):
|
||||
if self.has_data():
|
||||
|
@ -236,7 +236,7 @@ class Request:
|
|||
if self.type is None:
|
||||
self.type, self.__r_type = splittype(self.__original)
|
||||
if self.type is None:
|
||||
raise ValueError, "unknown url type: %s" % self.__original
|
||||
raise ValueError("unknown url type: %s" % self.__original)
|
||||
return self.type
|
||||
|
||||
def get_host(self):
|
||||
|
@ -1250,7 +1250,7 @@ class FTPHandler(BaseHandler):
|
|||
import mimetypes
|
||||
host = req.get_host()
|
||||
if not host:
|
||||
raise IOError, ('ftp error', 'no host given')
|
||||
raise IOError('ftp error', 'no host given')
|
||||
host, port = splitport(host)
|
||||
if port is None:
|
||||
port = ftplib.FTP_PORT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue