mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
Merge with 3.2.
This commit is contained in:
commit
74b6abf61f
3 changed files with 15 additions and 2 deletions
|
@ -1802,11 +1802,13 @@ class TarFile(object):
|
|||
fileobj = gzip.GzipFile(name, mode + "b", compresslevel, fileobj)
|
||||
t = cls.taropen(name, mode, fileobj, **kwargs)
|
||||
except IOError:
|
||||
if not extfileobj:
|
||||
if not extfileobj and fileobj is not None:
|
||||
fileobj.close()
|
||||
if fileobj is None:
|
||||
raise
|
||||
raise ReadError("not a gzip file")
|
||||
except:
|
||||
if not extfileobj:
|
||||
if not extfileobj and fileobj is not None:
|
||||
fileobj.close()
|
||||
raise
|
||||
t._extfileobj = extfileobj
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue