summaryrefslogtreecommitdiffstats
path: root/Lib/tarfile.py
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2012-06-04 21:34:07 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2012-06-04 21:34:07 (GMT)
commit33c34da5745f2e3fdc315e5098295621d8023674 (patch)
tree224765898477deda4a8d39dbf574c476752b16dd /Lib/tarfile.py
parentaf518c198e249aae63a82a5a44c93c3e5cc140f4 (diff)
downloadcpython-33c34da5745f2e3fdc315e5098295621d8023674.zip
cpython-33c34da5745f2e3fdc315e5098295621d8023674.tar.gz
cpython-33c34da5745f2e3fdc315e5098295621d8023674.tar.bz2
Simplify usage of LZMAFile's fileobj support, like with BZ2File.
Diffstat (limited to 'Lib/tarfile.py')
-rw-r--r--Lib/tarfile.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 6d73569..7b9f407 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1681,8 +1681,7 @@ class TarFile(object):
except ImportError:
raise CompressionError("lzma module is not available")
- fileobj = lzma.LZMAFile(filename=name if fileobj is None else None,
- mode=mode, fileobj=fileobj, preset=preset)
+ fileobj = lzma.LZMAFile(fileobj or name, mode, preset=preset)
try:
t = cls.taropen(name, mode, fileobj, **kwargs)