~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_bencode_pyx.pyx

  • Committer: John Arbash Meinel
  • Date: 2009-10-13 14:36:50 UTC
  • mto: This revision was merged to the branch mainline in revision 4749.
  • Revision ID: john@arbash-meinel.com-20091013143650-3f2gwb5uzi50tdcl
quick patch to allow bencode to handle StaticTuple objects.

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
from bzrlib._static_tuple_c cimport StaticTuple, StaticTuple_CheckExact, \
 
62
    import_static_tuple_c
 
63
 
 
64
import_static_tuple_c()
 
65
 
61
66
 
62
67
cdef class Decoder:
63
68
    """Bencode decoder"""
371
376
                self._encode_int(x)
372
377
            elif PyLong_CheckExact(x):
373
378
                self._encode_long(x)
374
 
            elif PyList_CheckExact(x) or PyTuple_CheckExact(x):
 
379
            elif (PyList_CheckExact(x) or PyTuple_CheckExact(x)
 
380
                  or StaticTuple_CheckExact(x)):
375
381
                self._encode_list(x)
376
382
            elif PyDict_CheckExact(x):
377
383
                self._encode_dict(x)