summaryrefslogtreecommitdiff
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
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)