From: Neal Norwitz Date: Fri, 11 Apr 2003 03:05:56 +0000 (+0000) Subject: Fix test_tarfile failure when gzip is not available X-Git-Tag: v2.3c1~1224 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ec6824896e22637a421cb99fdde694f0a1cdbc5;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 152b23c252c9..af733deb3233 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)