[elbe-devel] [PATCH] elbe: shebang: force python2

Andrey Skvortsov andrej.skvortzov at gmail.com
Thu Mar 23 09:00:43 CET 2017


On 17-03-22 10:44, Kurt Kanzenbach wrote:
> Seems like Elbe is written in Python2. However, some distributions ship Python3
> as default version. This results in errors like this:
> 
>   File "./elbe", line 29
>     print 'elbe v' + elbe_version
>                  ^
>   SyntaxError: Missing parentheses in call to 'print'
> 
> So better force the used version to Python2.

Wouldn't better to fix this error to use compatible with python3
implementation? 


from __future__ import print_function (introduced in python 2.6)

print('elbe v' + elbe_version)

It works equally on python2 and on python3. This'll help python3
migration overall.

Does elbe depend on any python2-only libraries?

> Signed-off-by: Kurt Kanzenbach <kurt at linutronix.de>
> ---
>  elbe | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/elbe b/elbe
> index c6e84d4..269b192 100755
> --- a/elbe
> +++ b/elbe
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env python
> +#!/usr/bin/env python2
>  #
>  # ELBE - Debian Based Embedded Rootfilesystem Builder
>  # Copyright (C) 2013  Linutronix GmbH
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Best regards,
Andrey Skvortsov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20170323/13006e0f/attachment.sig>


More information about the elbe-devel mailing list