~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_chk_map_pyx.pyx

  • Committer: Patch Queue Manager
  • Date: 2016-04-21 04:10:52 UTC
  • mfrom: (6616.1.1 fix-en-user-guide)
  • Revision ID: pqm@pqm.ubuntu.com-20160421041052-clcye7ns1qcl2n7w
(richard-wilbur) Ensure build of English use guide always uses English text
 even when user's locale specifies a different language. (Jelmer Vernooij)

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)