/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: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2020-02-14 03:16:54 UTC
  • mfrom: (7479.2.3 no-more-python2)
  • Revision ID: breezy.the.bot@gmail.com-20200214031654-bp1xtv2jr9nmhto3
Drop python2 support.

Merged from https://code.launchpad.net/~jelmer/brz/no-more-python2/+merge/378694

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):