We dont support ancient python versions...
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 22 Sep 2009 13:28:58 +0000 (16:28 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 22 Sep 2009 13:28:58 +0000 (16:28 +0300)
python/header-py.c
python/rpmdb-py.c
python/rpmds-py.c
python/rpmfd-py.c
python/rpmfi-py.c
python/rpmmi-py.c
python/rpmmodule.c
python/rpmps-py.c
python/rpmte-py.c
python/rpmts-py.c

index 5049db1..f1c1f66 100644 (file)
@@ -526,7 +526,6 @@ PyTypeObject hdr_Type = {
        0,                              /* tp_as_buffer */
        Py_TPFLAGS_DEFAULT,             /* tp_flags */
        hdr_doc,                        /* tp_doc */
-#if Py_TPFLAGS_HAVE_ITER
        0,                              /* tp_traverse */
        0,                              /* tp_clear */
        0,                              /* tp_richcompare */
@@ -546,7 +545,6 @@ PyTypeObject hdr_Type = {
        0,                              /* tp_new */
        0,                              /* tp_free */
        0,                              /* tp_is_gc */
-#endif
 };
 
 hdrObject * hdr_Wrap(Header h)
index 44be4d5..c677852 100644 (file)
@@ -236,7 +236,6 @@ PyTypeObject rpmdb_Type = {
        0,                              /* tp_as_buffer */
        Py_TPFLAGS_DEFAULT,             /* tp_flags */
        rpmdb_doc,                      /* tp_doc */
-#if Py_TPFLAGS_HAVE_ITER
        0,                              /* tp_traverse */
        0,                              /* tp_clear */
        0,                              /* tp_richcompare */
@@ -256,6 +255,5 @@ PyTypeObject rpmdb_Type = {
        0,                              /* tp_new */
        0,                              /* tp_free */
        0,                              /* tp_is_gc */
-#endif
 };
 
index e42b93a..7dd5a0b 100644 (file)
@@ -577,7 +577,6 @@ PyTypeObject rpmds_Type = {
        Py_TPFLAGS_DEFAULT |            /* tp_flags */
            Py_TPFLAGS_HAVE_RICHCOMPARE,
        rpmds_doc,                      /* tp_doc */
-#if Py_TPFLAGS_HAVE_ITER
        0,                              /* tp_traverse */
        0,                              /* tp_clear */
        (richcmpfunc) rpmds_richcompare,/* tp_richcompare */
@@ -597,7 +596,6 @@ PyTypeObject rpmds_Type = {
        (newfunc) rpmds_new,            /* tp_new */
        (freefunc) rpmds_free,          /* tp_free */
        0,                              /* tp_is_gc */
-#endif
 };
 
 /* ---------- */
index 215d1a9..dc92228 100644 (file)
@@ -274,7 +274,6 @@ PyTypeObject rpmfd_Type = {
        0,                              /* tp_as_buffer */
        Py_TPFLAGS_DEFAULT,             /* tp_flags */
        rpmfd_doc,                      /* tp_doc */
-#if Py_TPFLAGS_HAVE_ITER
        0,                              /* tp_traverse */
        0,                              /* tp_clear */
        0,                              /* tp_richcompare */
@@ -294,7 +293,6 @@ PyTypeObject rpmfd_Type = {
        (newfunc) rpmfd_new,            /* tp_new */
        (freefunc) rpmfd_free,          /* tp_free */
        0,                              /* tp_is_gc */
-#endif
 };
 
 rpmfdObject * rpmfd_Wrap(FD_t fd)
index 59c2e4c..d3a1875 100644 (file)
@@ -157,14 +157,12 @@ rpmfi_FClass(rpmfiObject * s)
     return Py_BuildValue("s", xstrdup(FClass));
 }
 
-#if Py_TPFLAGS_HAVE_ITER
 static PyObject *
 rpmfi_iter(rpmfiObject * s)
 {
     Py_INCREF(s);
     return (PyObject *)s;
 }
-#endif
 
 static PyObject *
 rpmfi_iternext(rpmfiObject * s)
@@ -473,7 +471,6 @@ PyTypeObject rpmfi_Type = {
        0,                              /* tp_as_buffer */
        Py_TPFLAGS_DEFAULT,             /* tp_flags */
        rpmfi_doc,                      /* tp_doc */
-#if Py_TPFLAGS_HAVE_ITER
        0,                              /* tp_traverse */
        0,                              /* tp_clear */
        0,                              /* tp_richcompare */
@@ -493,7 +490,6 @@ PyTypeObject rpmfi_Type = {
        (newfunc) rpmfi_new,            /* tp_new */
        (freefunc) rpmfi_free,          /* tp_free */
        0,                              /* tp_is_gc */
-#endif
 };
 
 /* ---------- */
index 3c347ac..1b9907e 100644 (file)
@@ -223,7 +223,6 @@ PyTypeObject rpmmi_Type = {
        0,                              /* tp_as_buffer */
        Py_TPFLAGS_DEFAULT,             /* tp_flags */
        rpmmi_doc,                      /* tp_doc */
-#if Py_TPFLAGS_HAVE_ITER
        0,                              /* tp_traverse */
        0,                              /* tp_clear */
        0,                              /* tp_richcompare */
@@ -243,7 +242,6 @@ PyTypeObject rpmmi_Type = {
        0,                              /* tp_new */
        0,                              /* tp_free */
        0,                              /* tp_is_gc */
-#endif
 };
 
 rpmmiObject * rpmmi_Wrap(rpmdbMatchIterator mi, PyObject *s)
index d0ea29b..4984e30 100644 (file)
@@ -234,7 +234,6 @@ void init_rpm(void)
 {
     PyObject * d, *o, *tag = NULL, *dict, *m;
 
-#if Py_TPFLAGS_HAVE_ITER        /* XXX backport to python-1.5.2 */
     if (PyType_Ready(&hdr_Type) < 0) return;
     if (PyType_Ready(&rpmds_Type) < 0) return;
     if (PyType_Ready(&rpmfd_Type) < 0) return;
@@ -245,7 +244,6 @@ void init_rpm(void)
     if (PyType_Ready(&rpmte_Type) < 0) return;
     if (PyType_Ready(&rpmts_Type) < 0) return;
     if (PyType_Ready(&spec_Type) < 0) return;
-#endif
 
     m = Py_InitModule3("_rpm", rpmModuleMethods, rpm__doc__);
     if (m == NULL)
@@ -266,7 +264,6 @@ void init_rpm(void)
     if (pyrpmError != NULL)
        PyDict_SetItemString(d, "error", pyrpmError);
 
-#if Py_TPFLAGS_HAVE_ITER        /* XXX backport to python-1.5.2 */
     Py_INCREF(&hdr_Type);
     PyModule_AddObject(m, "hdr", (PyObject *) &hdr_Type);
 
@@ -293,17 +290,6 @@ void init_rpm(void)
 
     Py_INCREF(&spec_Type);
     PyModule_AddObject(m, "spec", (PyObject *) &spec_Type);
-#else
-    hdr_Type.ob_type = &PyType_Type;
-    rpmds_Type.ob_type = &PyType_Type;
-    rpmfd_Type.ob_type = &PyType_Type;
-    rpmfi_Type.ob_type = &PyType_Type;
-    rpmmi_Type.ob_type = &PyType_Type;
-    rpmps_Type.ob_type = &PyType_Type;
-    rpmte_Type.ob_type = &PyType_Type;
-    rpmts_Type.ob_type = &PyType_Type;
-    spec_Type.ob_type =  &PyType_Type;
-#endif
 
     dict = PyDict_New();
     {  const char *tname, *sname;
index 1914c6c..718a9bb 100644 (file)
@@ -254,7 +254,6 @@ PyTypeObject rpmps_Type = {
        0,                              /* tp_as_buffer */
        Py_TPFLAGS_DEFAULT,             /* tp_flags */
        rpmps_doc,                      /* tp_doc */
-#if Py_TPFLAGS_HAVE_ITER
        0,                              /* tp_traverse */
        0,                              /* tp_clear */
        (richcmpfunc)0,                 /* tp_richcompare */
@@ -274,7 +273,6 @@ PyTypeObject rpmps_Type = {
        (newfunc) rpmps_new,            /* tp_new */
        (freefunc) rpmps_free,          /* tp_free */
        0,                              /* tp_is_gc */
-#endif
 };
 
 /* ---------- */
index 75d1cb1..412e543 100644 (file)
@@ -335,7 +335,6 @@ PyTypeObject rpmte_Type = {
        0,                              /* tp_as_buffer */
        Py_TPFLAGS_DEFAULT,             /* tp_flags */
        rpmte_doc,                      /* tp_doc */
-#if Py_TPFLAGS_HAVE_ITER
        0,                              /* tp_traverse */
        0,                              /* tp_clear */
        0,                              /* tp_richcompare */
@@ -355,7 +354,6 @@ PyTypeObject rpmte_Type = {
        0,                              /* tp_new */
        0,                              /* tp_free */
        0,                              /* tp_is_gc */
-#endif
 };
 
 rpmteObject * rpmte_Wrap(rpmte te)
index d4f2cf2..5d7c12c 100644 (file)
@@ -967,7 +967,6 @@ fprintf(stderr, "*** rpmts_Run(%p) ts %p ignore %x\n", s, s->ts, s->ignoreSet);
     return list;
 }
 
-#if Py_TPFLAGS_HAVE_ITER
 static PyObject *
 rpmts_iter(rpmtsObject * s)
 {
@@ -977,7 +976,6 @@ fprintf(stderr, "*** rpmts_iter(%p) ts %p\n", s, s->ts);
     Py_INCREF(s);
     return (PyObject *)s;
 }
-#endif
 
 /**
  * @todo Add TR_ADDED filter to iterator.
@@ -1352,7 +1350,6 @@ PyTypeObject rpmts_Type = {
        0,                              /* tp_as_buffer */
        Py_TPFLAGS_DEFAULT,             /* tp_flags */
        rpmts_doc,                      /* tp_doc */
-#if Py_TPFLAGS_HAVE_ITER
        0,                              /* tp_traverse */
        0,                              /* tp_clear */
        0,                              /* tp_richcompare */
@@ -1372,7 +1369,6 @@ PyTypeObject rpmts_Type = {
        (newfunc) rpmts_new,            /* tp_new */
        (freefunc) rpmts_free,          /* tp_free */
        0,                              /* tp_is_gc */
-#endif
 };
 
 /**