~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_chk_map_pyx.pyx

  • Committer: Vincent Ladeuil
  • Date: 2017-01-17 13:48:10 UTC
  • mfrom: (6615.3.6 merges)
  • mto: This revision was merged to the branch mainline in revision 6620.
  • Revision ID: v.ladeuil+lp@free.fr-20170117134810-j9p3lidfy6pfyfsc
Merge 2.7, resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
413
413
    cdef Py_ssize_t byte_size, pos, file_id_len
414
414
 
415
415
    if not PyString_CheckExact(bytes):
416
 
        raise TypeError('bytes must be a string')
 
416
        raise TypeError('bytes must be a string, got %r' % (type(bytes),))
417
417
    byte_str = PyString_AS_STRING(bytes)
418
418
    byte_size = PyString_GET_SIZE(bytes)
419
419
    byte_end = byte_str + byte_size
421
421
    if cur_end == NULL:
422
422
        raise ValueError('No kind section found.')
423
423
    if cur_end[1] != c' ':
424
 
        raise ValueError('Kind section should end with ": "')
 
424
        raise ValueError(
 
425
            'Kind section should end with ": ", got %r' % str(cur_end[:2],))
425
426
    file_id_str = cur_end + 2
426
427
    # file_id is now the data up until the next newline
427
428
    cur_end = <char*>memchr(file_id_str, c'\n', byte_end - file_id_str)