summaryrefslogtreecommitdiff
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2012-06-04 23:31:20 +0200
committerNadeem Vawda <nadeem.vawda@gmail.com>2012-06-04 23:31:20 +0200
commitaebcdba8297bf5174ecf4e8687ad23883e35b14b (patch)
treeb9b55d8bb72a27f439da47f98d676f56876d8237 /Lib/tarfile.py
parent68721019efb16ba8acad036c331a9a195d6f7da0 (diff)
downloadcpython-git-aebcdba8297bf5174ecf4e8687ad23883e35b14b.tar.gz
Make BZ2File's fileobj support easier to use.
The fileobj argument was added during the 3.3 development cycle, so this change does not break backward compatibility with 3.2.
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 854967751d..6d735699fc 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1657,8 +1657,8 @@ class TarFile(object):
except ImportError:
raise CompressionError("bz2 module is not available")
- fileobj = bz2.BZ2File(filename=name if fileobj is None else None,
- mode=mode, fileobj=fileobj, compresslevel=compresslevel)
+ fileobj = bz2.BZ2File(fileobj or name, mode,
+ compresslevel=compresslevel)
try:
t = cls.taropen(name, mode, fileobj, **kwargs)