summaryrefslogtreecommitdiffstats
path: root/Lib/mailbox.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-05 06:37:24 (GMT)
committerGitHub <noreply@github.com>2017-04-05 06:37:24 (GMT)
commit5affd23e6f42125998724787025080a24839266e (patch)
tree8b7ca82362e78a32805b117d574082d512251d3c /Lib/mailbox.py
parent43ba8861e0ad044efafa46a7cc04e12ac5df640e (diff)
downloadcpython-5affd23e6f42125998724787025080a24839266e.zip
cpython-5affd23e6f42125998724787025080a24839266e.tar.gz
cpython-5affd23e6f42125998724787025080a24839266e.tar.bz2
bpo-29762: More use "raise from None". (#569)
This hides unwanted implementation details from tracebacks.
Diffstat (limited to 'Lib/mailbox.py')
-rw-r--r--Lib/mailbox.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
index 39f24f9..056251d 100644
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -555,7 +555,7 @@ class Maildir(Mailbox):
try:
return self._toc[key]
except KeyError:
- raise KeyError('No message with key: %s' % key)
+ raise KeyError('No message with key: %s' % key) from None
# This method is for backward compatibility only.
def next(self):
@@ -741,7 +741,7 @@ class _singlefileMailbox(Mailbox):
try:
return self._toc[key]
except KeyError:
- raise KeyError('No message with key: %s' % key)
+ raise KeyError('No message with key: %s' % key) from None
def _append_message(self, message):
"""Append message to mailbox and return (start, stop) offsets."""
@@ -1572,7 +1572,7 @@ class MaildirMessage(Message):
try:
self._date = float(date)
except ValueError:
- raise TypeError("can't convert to float: %s" % date)
+ raise TypeError("can't convert to float: %s" % date) from None
def get_info(self):
"""Get the message's "info" as a string."""