Kaydet (Commit) 4ec68248 authored tarafından Neal Norwitz's avatar Neal Norwitz

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.
üst ffe33b7f
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment