~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_bencode_pyx.pyx

(jam) Start using StaticTuple as part of the btree_index parsing code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    void D_UPDATE_TAIL(Decoder, int n)
59
59
    void E_UPDATE_TAIL(Encoder, int n)
60
60
 
 
61
# To maintain compatibility with older versions of pyrex, we have to use the
 
62
# relative import here, rather than 'bzrlib._static_tuple_c'
 
63
from _static_tuple_c cimport StaticTuple, StaticTuple_CheckExact, \
 
64
    import_static_tuple_c
 
65
 
 
66
import_static_tuple_c()
 
67
 
61
68
 
62
69
cdef class Decoder:
63
70
    """Bencode decoder"""
371
378
                self._encode_int(x)
372
379
            elif PyLong_CheckExact(x):
373
380
                self._encode_long(x)
374
 
            elif PyList_CheckExact(x) or PyTuple_CheckExact(x):
 
381
            elif (PyList_CheckExact(x) or PyTuple_CheckExact(x)
 
382
                  or StaticTuple_CheckExact(x)):
375
383
                self._encode_list(x)
376
384
            elif PyDict_CheckExact(x):
377
385
                self._encode_dict(x)