aboutsummaryrefslogtreecommitdiff
path: root/python/version_spec.cc
diff options
context:
space:
mode:
authorAvatar zaufi <i.zaufi@gmail.com> 2013-12-13 01:47:46 +0400
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2013-12-29 19:59:08 +0000
commitff990637e2397690ce911a762d1ce089acd602ad (patch)
tree00e2d13bd96a6a4bb90761bdb3d2d9e11b39e9a4 /python/version_spec.cc
parentfddcb26bc121d802d79b67034ef90cb7a99338ff (diff)
downloadpaludis-ff990637e2397690ce911a762d1ce089acd602ad.tar.gz
paludis-ff990637e2397690ce911a762d1ce089acd602ad.tar.xz
Make it Python3 compatible
Diffstat (limited to 'python/version_spec.cc')
-rw-r--r--python/version_spec.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/version_spec.cc b/python/version_spec.cc
index 17e6d7260..1619a6c3d 100644
--- a/python/version_spec.cc
+++ b/python/version_spec.cc
@@ -95,7 +95,16 @@ void expose_version_spec()
"Revision part only (or \"r0\")."
)
+#if PY_MAJOR_VERSION < 3
.def("__cmp__", &VersionSpec::compare)
+#else
+ .def(bp::self == bp::self)
+ .def(bp::self != bp::self)
+ .def(bp::self < bp::self)
+ .def(bp::self <= bp::self)
+ .def(bp::self > bp::self)
+ .def(bp::self >= bp::self)
+#endif
.def(bp::self_ns::str(bp::self))
;