diff options
author | Jelmer Vernooij <jelmer@jelmer.uk> | 2016-07-24 15:27:09 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@jelmer.uk> | 2016-07-24 15:27:09 +0000 |
commit | 8552a36d368106dbcd9aedf9d5ffe115b83bc501 (patch) | |
tree | 5d3387b9f7c030f9aafd40a7a568c3998cbfd3c3 /subvertpy/_ra_iter_log.c | |
parent | 178e77a9b8418965ed68a14c58487c338ae621cd (diff) |
More python3 compatibility work.
Diffstat (limited to 'subvertpy/_ra_iter_log.c')
-rw-r--r-- | subvertpy/_ra_iter_log.c | 55 |
1 files changed, 9 insertions, 46 deletions
diff --git a/subvertpy/_ra_iter_log.c b/subvertpy/_ra_iter_log.c index 110df3f8..c430a6a6 100644 --- a/subvertpy/_ra_iter_log.c +++ b/subvertpy/_ra_iter_log.c @@ -120,54 +120,17 @@ PyTypeObject LogIterator_Type = { 0,/* Py_ssize_t tp_basicsize, tp_itemsize; For allocation */ /* Methods to implement standard operations */ - - (destructor)log_iter_dealloc, /* destructor tp_dealloc; */ - NULL, /* printfunc tp_print; */ - NULL, /* getattrfunc tp_getattr; */ - NULL, /* setattrfunc tp_setattr; */ - NULL, /* cmpfunc tp_compare; */ - NULL, /* reprfunc tp_repr; */ - - /* Method suites for standard classes */ - - NULL, /* PyNumberMethods *tp_as_number; */ - NULL, /* PySequenceMethods *tp_as_sequence; */ - NULL, /* PyMappingMethods *tp_as_mapping; */ - - /* More standard operations (here for binary compatibility) */ - - NULL, /* hashfunc tp_hash; */ - NULL, /* ternaryfunc tp_call; */ - NULL, /* reprfunc tp_str; */ - NULL, /* getattrofunc tp_getattro; */ - NULL, /* setattrofunc tp_setattro; */ - - /* Functions to access object as input/output buffer */ - NULL, /* PyBufferProcs *tp_as_buffer; */ - + + .tp_dealloc = (destructor)log_iter_dealloc, /* destructor tp_dealloc; */ + +#if PY_MAJOR_VERSION < 3 /* Flags to define presence of optional/expanded features */ - Py_TPFLAGS_HAVE_ITER, /* long tp_flags; */ - - NULL, /* const char *tp_doc; Documentation string */ - - /* Assigned meaning in release 2.0 */ - /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ - - /* delete references to contained objects */ - NULL, /* inquiry tp_clear; */ - - /* Assigned meaning in release 2.1 */ - /* rich comparisons */ - NULL, /* richcmpfunc tp_richcompare; */ - - /* weak reference enabler */ - 0, /* Py_ssize_t tp_weaklistoffset; */ - - /* Added in release 2.2 */ + .tp_flags = Py_TPFLAGS_HAVE_ITER, /* long tp_flags; */ +#endif + /* Iterators */ - PyObject_SelfIter, /* getiterfunc tp_iter; */ - (iternextfunc)log_iter_next, /* iternextfunc tp_iternext; */ + .tp_iter = PyObject_SelfIter, + .tp_iternext = (iternextfunc)log_iter_next, }; #if ONLY_SINCE_SVN(1, 5) |