diff options
author | Éric Araujo <merwok@netwok.org> | 2011-08-19 01:07:39 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-08-19 01:07:39 (GMT) |
commit | e7329f47e777d75a6602418f3198589828c35fce (patch) | |
tree | ff8e347615836328b741af06e8d5d3b2e783305f /Lib/shutil.py | |
parent | 99c4c340e6bb61966643c54b4ff3db832237203a (diff) | |
download | cpython-e7329f47e777d75a6602418f3198589828c35fce.zip cpython-e7329f47e777d75a6602418f3198589828c35fce.tar.gz cpython-e7329f47e777d75a6602418f3198589828c35fce.tar.bz2 |
Guard shutil._make_archive against a logger=None argument.
Backporting two lines from the 3.x tests was enough to trigger the bug.
I also took the opportunity of making the logging call lazy.
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r-- | Lib/shutil.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index 9d922fb..59a38fe 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -359,7 +359,8 @@ def _make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0, archive_dir = os.path.dirname(archive_name) if not os.path.exists(archive_dir): - logger.info("creating %s" % archive_dir) + if logger is not None: + logger.info("creating %s", archive_dir) if not dry_run: os.makedirs(archive_dir) |