/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/archive/tar.py

  • Committer: Jelmer Vernooij
  • Date: 2020-02-07 02:14:30 UTC
  • mto: This revision was merged to the branch mainline in revision 7492.
  • Revision ID: jelmer@jelmer.uk-20200207021430-m49iq3x4x8xlib6x
Drop python2 support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from __future__ import absolute_import
20
20
 
21
21
from contextlib import closing
 
22
from io import BytesIO
22
23
import os
23
24
import sys
24
25
import tarfile
28
29
    osutils,
29
30
    )
30
31
from ..export import _export_iter_entries
31
 
from ..sixish import (
32
 
    BytesIO,
33
 
    )
34
32
 
35
33
 
36
34
def prepare_tarball_item(tree, root, final_path, tree_path, entry, force_mtime=None):
185
183
    except ImportError as e:
186
184
        raise errors.DependencyNotPresent('lzma', e)
187
185
 
188
 
    if sys.version_info[0] == 2:
189
 
        compressor = lzma.LZMACompressor(
190
 
            options={"format": compression_format})
191
 
    else:
192
 
        compressor = lzma.LZMACompressor(
193
 
            format={
194
 
                'xz': lzma.FORMAT_XZ,
195
 
                'raw': lzma.FORMAT_RAW,
196
 
                'alone': lzma.FORMAT_ALONE,
197
 
                }[compression_format])
 
186
    compressor = lzma.LZMACompressor(
 
187
        format={
 
188
            'xz': lzma.FORMAT_XZ,
 
189
            'raw': lzma.FORMAT_RAW,
 
190
            'alone': lzma.FORMAT_ALONE,
 
191
            }[compression_format])
198
192
 
199
193
    for chunk in tarball_generator(
200
194
            tree, root, subdir, force_mtime=force_mtime):