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 | c5270c2c909725f2523ba8cf23892ca9e99bd79e (patch) | |
| tree | d0a80a41b2aefc006d6ee138610f2a18a8835c20 /reporters | |
| parent | 37b07b305fb190df034b2810d47e194938fc26ce (diff) | |
| download | pylint-git-c5270c2c909725f2523ba8cf23892ca9e99bd79e.tar.gz | |
redefine cmp under py3k. Closes #120635
Diffstat (limited to 'reporters')
| -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 8be46b71b..99cf2b7c9 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 |
