From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masahiro Yamada Date: Mon, 04 Aug 2014 22:28:35 +0900 Subject: [U-Boot] [RFC PATCH v2 0/2] Make Python scripts compatible with older versions In-Reply-To: <53DF87CC.3050104@compulab.co.il> References: <20140804215937.D55E.AA925319@jp.panasonic.com> <53DF87CC.3050104@compulab.co.il> Message-ID: <20140804222835.D562.AA925319@jp.panasonic.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Igor, On Mon, 04 Aug 2014 16:17:00 +0300 Igor Grinberg wrote: > Hi Masahiro, > > On 08/04/14 15:59, Masahiro Yamada wrote: > > Hi. > > > >> > >>> It seems that those scripts only work on Python versions 2.6 - 2.7? > > > > > > > > I took a quick look and I found Python 3.x is not comatible 2.x at all. > > > > 3.x requires the "print" is called like > > print(msg, file=sys.stderr) > > but it failes in Python 2.7.x. > > Last time I checked the print function, it worked with parenthesis on > both versions 2.7 and 3.x. I think print("helloworld") works on both 2.x and 3.x. On 2.x, ( ) is just meaningless parantheses and simply omitted. On 3.x, ( ) is mandatory for function call. print("helloworld", file=sys.stderr) never works on 2.x because the print statement does not take named arguments Best Masahiro Yamada