~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_static_tuple_c.c

  • Committer: John Arbash Meinel
  • Date: 2009-10-21 14:27:00 UTC
  • mto: This revision was merged to the branch mainline in revision 4761.
  • Revision ID: john@arbash-meinel.com-20091021142700-rdadmjxsdi3kzn01
Review feedback from Andrew.

Disallow adding a subclass of str/unicode/int/float/long. Just in
case those subclasses can have refcycles.

Show diffs side-by-side

added added

removed removed

Lines of Context:
244
244
            || StaticTuple_CheckExact(obj)
245
245
            || obj == Py_None
246
246
            || PyBool_Check(obj)
247
 
            || PyInt_Check(obj)
248
 
            || PyLong_Check(obj)
249
 
            || PyFloat_Check(obj)
250
 
            || PyUnicode_Check(obj)
 
247
            || PyInt_CheckExact(obj)
 
248
            || PyLong_CheckExact(obj)
 
249
            || PyFloat_CheckExact(obj)
 
250
            || PyUnicode_CheckExact(obj)
251
251
            ) continue;
252
252
        PyErr_Format(PyExc_TypeError, "StaticTuple(...)"
253
253
            " requires that all items are one of"