Berker Peksag added the comment:
diff -r 8f85262fbe8a Lib/nntplib.py
--- a/Lib/nntplib.py Sun Jul 06 02:24:24 2014 -0400
+++ b/Lib/nntplib.py Thu Jul 10 16:10:38 2014 -0700
@@ -122,6 +122,9 @@
"""Error in response data"""
pass
+class NNTPConnectError(NNTPError):
+ """Error during connection establishment."""
+ pass
Could you also document the new exception? (See Doc/library/nntplib.rst and
please add a versionadded directive)
The pass statement is redundant, but we could keep it to be consistent with
rest of the library.
@@ -435,7 +438,7 @@
raise NNTPDataError('line too long')
if self.debugging > 1:
print('*get*', repr(line))
- if not line: raise EOFError
+ if not line: raise NNTPConnectError()
if not line:
raise NNTPConnectError
looks more readable to me.
Also, you could add a more descriptive error message.
----------
nosy: +berker.peksag
versions: +Python 3.5 -Python 3.2
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue1186900>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com