From 153606ae464d3db3d69bfdfebc84b877e6e5c33b Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 6 Oct 2009 20:50:19 +0200 Subject: [PATCH] [entropy.const] add const_cmp, compat function --- libraries/entropy/const.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/entropy/const.py b/libraries/entropy/const.py index 94a2fa607..6527cd508 100644 --- a/libraries/entropy/const.py +++ b/libraries/entropy/const.py @@ -1447,6 +1447,12 @@ def const_isfileobj(obj): else: return isinstance(obj, file) +def const_cmp(a, b): + """ + cmp() is gone in Python 3.x provide our own implementation. + """ + return (a > b) - (a < b) + def const_islive(): """ Live environments (Operating System running off a CD/DVD)