From: Tobias Brunner Date: Tue, 13 May 2014 09:10:11 +0000 (+0200) Subject: conf: Fix sorting of options with Python 3 X-Git-Tag: 5.2.0dr4~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35952dc13f1f7550af5653cd4ffe69a4b602fd72;p=thirdparty%2Fstrongswan.git conf: Fix sorting of options with Python 3 __cmp__() is not supported anymore with Python 3 and cmp() is deprecated. Instead rich comparisons should be used (only __lt__() is required for sorting). --- diff --git a/conf/format-options.py b/conf/format-options.py index 5f850af00b..d046e24caa 100755 --- a/conf/format-options.py +++ b/conf/format-options.py @@ -67,8 +67,8 @@ class ConfigOption: self.desc = [] self.options = [] - def __cmp__(self, other): - return cmp(self.name, other.name) + def __lt__(self, other): + return self.name < other.name def add_paragraph(self): """Adds a new paragraph to the description"""