diff options
author | Nadeem Vawda <nadeem.vawda@gmail.com> | 2012-06-04 21:34:07 (GMT) |
---|---|---|
committer | Nadeem Vawda <nadeem.vawda@gmail.com> | 2012-06-04 21:34:07 (GMT) |
commit | 33c34da5745f2e3fdc315e5098295621d8023674 (patch) | |
tree | 224765898477deda4a8d39dbf574c476752b16dd /Lib/tarfile.py | |
parent | af518c198e249aae63a82a5a44c93c3e5cc140f4 (diff) | |
download | cpython-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.py | 3 |
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) |