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.
This commit is contained in:
parent
ffe33b7f24
commit
4ec6824896
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user