/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/_chunks_to_lines_py.py

  • Committer: Breezy landing bot
  • Author(s): Martin
  • Date: 2017-06-11 01:56:34 UTC
  • mfrom: (6684.1.5 py3_bootstrap2)
  • Revision ID: breezy.the.bot@gmail.com-20170611015634-9eeh86thh073hcko
More progress towards Python 3 support

Merged from https://code.launchpad.net/~gz/brz/py3_bootstrap2/+merge/325452

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        if not chunk:
42
42
            # Empty strings are never valid lines
43
43
            break
44
 
        elif '\n' in chunk[:-1]:
 
44
        elif b'\n' in chunk[:-1]:
45
45
            # This chunk has an extra '\n', so we will have to split it
46
46
            break
47
 
        elif chunk[-1] != '\n':
 
47
        elif chunk[-1:] != b'\n':
48
48
            # This chunk does not have a trailing newline
49
49
            last_no_newline = True
50
50
    else:
56
56
 
57
57
    # These aren't simple lines, just join and split again.
58
58
    from breezy import osutils
59
 
    return osutils._split_lines(''.join(chunks))
 
59
    return osutils._split_lines(b''.join(chunks))