summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2003-04-11 03:05:56 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2003-04-11 03:05:56 (GMT)
commit4ec6824896e22637a421cb99fdde694f0a1cdbc5 (patch)
treeab7a15b39c0eb1c3720e8631e89803e80b819e86 /Lib/tarfile.py
parentffe33b7f2416132d2e5b64683dbcc2aaf0596937 (diff)
downloadcpython-4ec6824896e22637a421cb99fdde694f0a1cdbc5.zip
cpython-4ec6824896e22637a421cb99fdde694f0a1cdbc5.tar.gz
cpython-4ec6824896e22637a421cb99fdde694f0a1cdbc5.tar.bz2
Fix test_tarfile failure when gzip is not available
The module would exist, but be empty if already imported. This change ensures we have gzip available.
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 152b23c..af733de 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -923,7 +923,8 @@ class TarFile(object):
try:
import gzip
- except ImportError:
+ gzip.GzipFile
+ except (ImportError, AttributeError):
raise CompressionError, "gzip module is not available"
pre, ext = os.path.splitext(name)