diff options
author | R David Murray <rdmurray@bitdance.com> | 2012-06-09 02:45:46 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2012-06-09 02:45:46 (GMT) |
commit | 6e50b699ac60e5e7c3d92b0f5cbb96da618f3908 (patch) | |
tree | 9a245d3370b6ea7b291d9e4cd31ab6d148385ad9 | |
parent | 5248a2d3c1969380c678e8d95f24a681fb772911 (diff) | |
download | cpython-6e50b699ac60e5e7c3d92b0f5cbb96da618f3908.zip cpython-6e50b699ac60e5e7c3d92b0f5cbb96da618f3908.tar.gz cpython-6e50b699ac60e5e7c3d92b0f5cbb96da618f3908.tar.bz2 |
Now that Defects are Exception subclasses, call super.
The behavior of MessageDefect is legacy behavior. The chances anyone is
actually using the undocumented 'line' attribute is low, but it costs
little to retain backward compatibility. Although one of the costs is
having to restore normal exception behavior in HeaderDefect. On the
other hand, I'll probably add some specialized behavior there later.
-rw-r--r-- | Lib/email/errors.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/email/errors.py b/Lib/email/errors.py index d80b5b9..791239f 100644 --- a/Lib/email/errors.py +++ b/Lib/email/errors.py @@ -34,6 +34,8 @@ class MessageDefect(ValueError): """Base class for a message defect.""" def __init__(self, line=None): + if line is not None: + super().__init__(line) self.line = line class NoBoundaryInMultipartDefect(MessageDefect): @@ -76,6 +78,9 @@ class InvalidBase64CharactersDefect(MessageDefect): class HeaderDefect(MessageDefect): """Base class for a header defect.""" + def __init__(self, *args, **kw): + super().__init__(*args, **kw) + class InvalidHeaderDefect(HeaderDefect): """Header is not valid, message gives details.""" |