diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2013-02-22 16:07:43 +0100 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2013-02-22 16:07:43 +0100 |
commit | 3d2d4bb0a878c4644b359ffb79a8a98dcbb253f5 (patch) | |
tree | 6d3a55bc4ef1d078e836fe57ba72e17ac9658fb4 | |
parent | a419a04c28f87027c04139105c9c737024e502f3 (diff) | |
download | pylint-3d2d4bb0a878c4644b359ffb79a8a98dcbb253f5.tar.gz |
redefine cmp under py3k. Closes #120635
-rw-r--r-- | reporters/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/reporters/__init__.py b/reporters/__init__.py index 8be46b7..99cf2b7 100644 --- a/reporters/__init__.py +++ b/reporters/__init__.py @@ -1,5 +1,5 @@ # Copyright (c) 2003-2010 Sylvain Thenault (thenault@gmail.com). -# Copyright (c) 2003-2012 LOGILAB S.A. (Paris, FRANCE). +# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later @@ -18,6 +18,11 @@ import sys, locale CMPS = ['=', '-', '+'] +# py3k has no more cmp builtin +if sys.version_info >= (3, 0): + def cmp(a, b): + return (a > b) - (a < b) + def diff_string(old, new): """given a old and new int value, return a string representing the difference |