summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.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/shutil.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/shutil.py')
-rw-r--r--Lib/shutil.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py
index bd4760f..31536fe 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -786,7 +786,7 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
try:
format_info = _ARCHIVE_FORMATS[format]
except KeyError:
- raise ValueError("unknown archive format '%s'" % format)
+ raise ValueError("unknown archive format '%s'" % format) from None
func = format_info[0]
for arg, val in format_info[1]:
@@ -962,7 +962,7 @@ def unpack_archive(filename, extract_dir=None, format=None):
try:
format_info = _UNPACK_FORMATS[format]
except KeyError:
- raise ValueError("Unknown unpack format '{0}'".format(format))
+ raise ValueError("Unknown unpack format '{0}'".format(format)) from None
func = format_info[1]
func(filename, extract_dir, **dict(format_info[2]))