summaryrefslogtreecommitdiffstats
path: root/Lib/shutil.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-11-27 22:48:46 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-11-27 22:48:46 (GMT)
commit9a4fc19589a080d8e21ade8d64034b78d500b004 (patch)
treee09882b00d2c4dd6276ab269d5f7a727a6758c06 /Lib/shutil.py
parentab5e9b9213558d00ef8405d89e4cb103795972e3 (diff)
downloadcpython-9a4fc19589a080d8e21ade8d64034b78d500b004.zip
cpython-9a4fc19589a080d8e21ade8d64034b78d500b004.tar.gz
cpython-9a4fc19589a080d8e21ade8d64034b78d500b004.tar.bz2
Issue #21280: Fixed a bug in shutil.make_archive() when create an archive of
current directory in current directory.
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 b5e7cbe..22958f4 100644
--- a/Lib/shutil.py
+++ b/Lib/shutil.py
@@ -600,7 +600,7 @@ def _make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
archive_name = base_name + '.tar' + compress_ext.get(compress, '')
archive_dir = os.path.dirname(archive_name)
- if not os.path.exists(archive_dir):
+ if archive_dir and not os.path.exists(archive_dir):
if logger is not None:
logger.info("creating %s", archive_dir)
if not dry_run:
@@ -660,7 +660,7 @@ def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
zip_filename = base_name + ".zip"
archive_dir = os.path.dirname(base_name)
- if not os.path.exists(archive_dir):
+ if archive_dir and not os.path.exists(archive_dir):
if logger is not None:
logger.info("creating %s", archive_dir)
if not dry_run: