[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] xen/tools: support Python 2 and Python 3



On Thu, Feb 22, 2018 at 10:47:27AM -0600, Doug Goldstein wrote:
> On 2/22/18 6:54 AM, Andrew Cooper wrote:
> > On 22/02/18 05:52, Doug Goldstein wrote:
> >> These changes should make it possible to support modern Pythons as well
> >> as the oldest Python 2 still supported.
> >>
> >> Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx>
> > 
> > To the overall effect, this is definitely a good thing.  Some queries
> > however...
> > 
> 
> >> diff --git a/xen/tools/compat-build-header.py 
> >> b/xen/tools/compat-build-header.py
> >> index 32421b645b..546371225d 100755
> >> --- a/xen/tools/compat-build-header.py
> >> +++ b/xen/tools/compat-build-header.py
> >> @@ -23,4 +23,4 @@ pats = [
> >>  for line in sys.stdin.readlines():
> >>      for pat in pats:
> >>          line = re.subn(pat[0], pat[1], line)[0]
> >> -    print line.rstrip()
> >> +    sys.stdout.write(line.rstrip() + '\n')
> > 
> > Is there anything wrong with print(line.rstrip()) which is the more
> > common way of doing this?
> 
> The other scripts in the repo avoided using print as a function which
> was only added to Python 2.6 and newer if you use from __future__ import
> print_function. The README in the repo still says Python 2.3 and newer
> so I had assumed if I broke things prior to Python 2.6 it would be a
> show stopper. While Python 2.3 was released July 29th 2003 and Python
> 2.6 was released Oct 1st 2008 I figured changing this requirement was
> going to be met with the same difficultly I encountered last time
> suggesting that we only support versions of build tools released in the
> past decade.
> 

2.3 is more than ~15 years ago, can we seek to bump the version a bit.
:-)

2.6 is reaching its 10 birthday this year, maybe it is better to just
use that?

What difficulty you had last time?

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.