diff options
author | Éric Araujo <merwok@netwok.org> | 2011-01-29 20:32:11 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-01-29 20:32:11 (GMT) |
commit | ac4e58eb610f7da80396f5c5e0a5d5d15bf0cc3f (patch) | |
tree | 9a1726a878a42dd4c618c025ff1d1af880b255a7 /Lib/shutil.py | |
parent | 7dabf16f69f611ff1eee2cb83369c922cbff5112 (diff) | |
download | cpython-ac4e58eb610f7da80396f5c5e0a5d5d15bf0cc3f.zip cpython-ac4e58eb610f7da80396f5c5e0a5d5d15bf0cc3f.tar.gz cpython-ac4e58eb610f7da80396f5c5e0a5d5d15bf0cc3f.tar.bz2 |
Protect logging call against None argument (fixes #11045).
Initial patch by Kelsey Hightower. Approved by Raymond. A test was
non-trivial to write without calling the private function directly, so
we moved that for later.
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 b808633..d47c67c 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -391,7 +391,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) |