summaryrefslogtreecommitdiffstats
path: root/Lib/ftplib.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-08-17 05:06:49 (GMT)
committerFred Drake <fdrake@acm.org>2000-08-17 05:06:49 (GMT)
commit227b1204681a8bd7077bf1f8e9098b7e2e9f4c13 (patch)
tree25e36d9096e5ddcde4a12065b5d38d4dd9beed56 /Lib/ftplib.py
parent9b8d801c37fa29420848ebc1b50c601893b36287 (diff)
downloadcpython-227b1204681a8bd7077bf1f8e9098b7e2e9f4c13.zip
cpython-227b1204681a8bd7077bf1f8e9098b7e2e9f4c13.tar.gz
cpython-227b1204681a8bd7077bf1f8e9098b7e2e9f4c13.tar.bz2
Convert some old-style string exceptions to class exceptions.
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r--Lib/ftplib.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index 41c3b33..a15c412 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -56,16 +56,16 @@ FTP_PORT = 21
# Exception raised when an error or invalid response is received
-error_reply = 'ftplib.error_reply' # unexpected [123]xx reply
-error_temp = 'ftplib.error_temp' # 4xx errors
-error_perm = 'ftplib.error_perm' # 5xx errors
-error_proto = 'ftplib.error_proto' # response does not begin with [1-5]
+class Error(Exception): pass
+class error_reply(Error): pass # unexpected [123]xx reply
+class error_temp(Error): pass # 4xx errors
+class error_perm(Error): pass # 5xx errors
+class error_proto(Error): pass # response does not begin with [1-5]
# All exceptions (hopefully) that may be raised here and that aren't
# (always) programming errors on our side
-all_errors = (error_reply, error_temp, error_perm, error_proto, \
- socket.error, IOError, EOFError)
+all_errors = (Error, socket.error, IOError, EOFError)
# Line terminators (we always output CRLF, but accept any of CRLF, CR, LF)