aboutsummaryrefslogtreecommitdiff
path: root/python/version_spec.cc
diff options
context:
space:
mode:
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))
;