diff options
author | jbj <devnull@localhost> | 2004-11-09 06:59:34 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2004-11-09 06:59:34 +0000 |
commit | 487c902d2fe8ee7010154963e357e624ce849c7d (patch) | |
tree | 7600b4dd0a3dac3716a038f9f129c9b1ed3dd105 /python | |
parent | e5e4a65519c5138f505b19659ae60f2eb489c706 (diff) | |
download | rpm-487c902d2fe8ee7010154963e357e624ce849c7d.tar.gz rpm-487c902d2fe8ee7010154963e357e624ce849c7d.tar.bz2 rpm-487c902d2fe8ee7010154963e357e624ce849c7d.zip |
- python: add python 2.4 support.
CVS patchset: 7562
CVS date: 2004/11/09 06:59:34
Diffstat (limited to 'python')
-rw-r--r-- | python/Makefile.am | 14 | ||||
-rw-r--r-- | python/rpmdebug-py.c | 2 | ||||
-rw-r--r-- | python/rpmrc-py.c | 7 |
3 files changed, 15 insertions, 8 deletions
diff --git a/python/Makefile.am b/python/Makefile.am index 4e7ea3865..3cb04ea25 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -7,7 +7,7 @@ LINT = splint pylibdir = ${prefix}/lib@MARK64@/python@WITH_PYTHON_VERSION@ pyincdir = $(prefix)/include/python@WITH_PYTHON_VERSION@ -SUBDIRS = rpmdb # rpm +SUBDIRS = rpmdb rpm EXTRA_DIST = system.h rpmdebug-py.c @@ -38,16 +38,16 @@ mylibs= \ LDADD = pythondir = $(pylibdir)/site-packages -python_LTLIBRARIES = rpmmodule.la poptmodule.la +python_LTLIBRARIES = poptmodule.la -#rpmdir = $(pylibdir)/site-packages/rpm -#rpm_LTLIBRARIES = rpmmodule.la +rpmdir = $(pylibdir)/site-packages/rpm +rpm_LTLIBRARIES = _rpmmodule.la rpmdbdir = $(pylibdir)/site-packages/rpmdb rpmdb_LTLIBRARIES = _rpmdb.la -rpmmodule_la_LDFLAGS = $(mylibs) $(LIBS) -module -avoid-version -rpmmodule_la_LIBADD = @WITH_BEECRYPT_LIB@ +_rpmmodule_la_LDFLAGS = $(mylibs) $(LIBS) -module -avoid-version +_rpmmodule_la_LIBADD = @WITH_BEECRYPT_LIB@ _rpmdb_la_SOURCES = _rpmdb.c _rpmdb_la_LDFLAGS = $(mylibs) $(LIBS) -module -avoid-version @@ -55,7 +55,7 @@ _rpmdb_la_LDFLAGS = $(mylibs) $(LIBS) -module -avoid-version poptmodule_la_SOURCES = poptmodule.c poptmodule_la_LDFLAGS = $(mylibs) $(LIBS) -module -avoid-version -rpmmodule_la_SOURCES = rpmmodule.c header-py.c \ +_rpmmodule_la_SOURCES = rpmmodule.c header-py.c \ rpmal-py.c rpmds-py.c rpmdb-py.c rpmfd-py.c rpmfts-py.c \ rpmfi-py.c rpmmi-py.c rpmps-py.c rpmrc-py.c rpmte-py.c \ rpmts-py.c spec-py.c diff --git a/python/rpmdebug-py.c b/python/rpmdebug-py.c index d45bfc535..1ddab213a 100644 --- a/python/rpmdebug-py.c +++ b/python/rpmdebug-py.c @@ -46,7 +46,9 @@ static const char * lbl(void * s) if (o->ob_type == &PyCode_Type) return "Code"; if (o->ob_type == &PyComplex_Type) return "Complex"; if (o->ob_type == &PyDict_Type) return "Dict"; +#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 4 if (o->ob_type == &PyDictIter_Type) return "DictIter"; +#endif if (o->ob_type == &PyFile_Type) return "File"; if (o->ob_type == &PyFloat_Type) return "Float"; if (o->ob_type == &PyFrame_Type) return "Frame"; diff --git a/python/rpmrc-py.c b/python/rpmrc-py.c index b03bf4358..404a32841 100644 --- a/python/rpmrc-py.c +++ b/python/rpmrc-py.c @@ -207,6 +207,7 @@ fprintf(stderr, "*** rpmrc_richcompare(%p[%s],%p[%s],%x)\n", v, lbl(v), w, lbl(w return PyDict_Type.tp_richcompare(v, w, op); } +#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 4 /** */ static PyObject * rpmrc_iter(PyObject * s) @@ -244,6 +245,10 @@ fprintf(stderr, "*** rpmrc_next(%p[%s],%p)\n", s, lbl(s), args); return PyDictIter_Type.tp_methods[0].ml_meth(s, args); return NULL; } +#else +#define rpmrc_iter 0 +#define rpmrc_iternext 0 +#endif /** \ingroup py_c */ @@ -311,7 +316,7 @@ static struct PyMethodDef rpmrc_methods[] = { NULL }, { "delMacro", (PyCFunction) rpmrc_DelMacro, METH_VARARGS, NULL }, -#if Py_TPFLAGS_HAVE_ITER /* XXX backport to python-1.5.2 */ +#if Py_TPFLAGS_HAVE_ITER && PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 4 { "next", (PyCFunction) rpmrc_next, METH_VARARGS, "next() -- get the next value, or raise StopIteration"}, #endif |