[PATCH 1/7] Check for python2 if available

David Herrmann dh.herrmann at gmail.com
Thu Aug 22 02:54:13 PDT 2013


Hi

On Thu, Aug 22, 2013 at 6:52 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> On Sat, Aug 17, 2013 at 01:58:13PM +0200, David Herrmann wrote:
>> On some systems (specifically Arch Linux) /usr/bin/python is v3 while
>> /usr/bin/python2 is v2. Check for python2 and use it, iff available.
>> Otherwise fall back to python as usual.
>>
>> Signed-off-by: David Herrmann <dh.herrmann at gmail.com>
>
> good catch. though given how simple the script is I think it's better to
> just make the script compatible for version 2 and 3.
>
> The only issue here is print which can be replaced with str.format(). That
> is only available in 2.6 and above, but given that even RHEL6 ships 2.6,
> that's a reasonable requirement.

As I never learned any python, I cannot review that. But your approach
indeed seems better.

Regards
David


More information about the Input-tools mailing list