diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-11-28 00:49:50 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-11-28 00:49:50 +0200 |
commit | 0a99b2ab61e506da60d9c48e440412a75399d4d0 (patch) | |
tree | 96f7658f0a648f664695e7b9ea2295a7c7e36a7d /Lib/shutil.py | |
parent | f1fc9fb33d6e3181fde24d9fc1a5a224fda5c2ef (diff) | |
parent | 9a4fc19589a080d8e21ade8d64034b78d500b004 (diff) | |
download | cpython-git-0a99b2ab61e506da60d9c48e440412a75399d4d0.tar.gz |
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.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index 34a6511cd3..a0ff1cd1d8 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -617,7 +617,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: @@ -662,7 +662,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: |