~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_chk_map_pyx.pyx

(vila) Fix bzrlib.tests.test_gpg.TestVerify.test_verify_revoked_signature
 with recent versions of gpg. (Vincent Ladeuil)

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)