[Scons-users] sort function changes

Eric Fahlgren ericfahlgren at gmail.com
Wed Oct 11 14:52:23 EDT 2017


But isn't the 'sort' parameter just a bool, so no need for a function?

    def GenerateHelpText(self, env, sort=None):
        """
        Generate the help text for the options.

        env - an environment that is used to get the current values
              of the options.
        """

        if sort:
            options = sorted(self.options, key=lambda x: x.key)

On Wed, Oct 11, 2017 at 11:35 AM, Bill Deegan <bill at baddogconsulting.com>
wrote:

> Added this:
>
> Please comment
> https://github.com/SConsProject/scons/pull/12
>
> On Wed, Oct 11, 2017 at 11:31 AM, Bill Deegan <bill at baddogconsulting.com>
> wrote:
>
>> We ran into same issue in our VariablesTests.py (a unit test).
>>
>> Here's the implementation we used:
>>
>> def cmp(a, b):
>>     """
>>     Define cmp because it's no longer available in python3
>>     Works under python 2 as well
>>     """
>>     return (a > b) - (a < b)
>>
>> I'll make a note and see if we can provision this into SConscript/SConstruct environment..
>>
>>
>> On Wed, Oct 11, 2017 at 8:03 AM, Mats Wichmann <mats at wichmann.us> wrote:
>>
>>>
>>> This does not work with Python3, since cmp is gone:
>>>
>>>     Help(help_vars.GenerateHelpText(env, sort=cmp))
>>>
>>>
>>> Quick suggestion?
>>> _______________________________________________
>>> Scons-users mailing list
>>> Scons-users at scons.org
>>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>>
>>
>>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171011/2e5f5429/attachment-0001.html>


More information about the Scons-users mailing list