Skip to contentSkip to conversation

backports: specify python2.7 for gentree.py

PATCH In review Thomas Pedersen 3 participants 5 messages Jun 2, 2013 – Jun 3, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backports: specify python2.7 for gentree.py

Apparently gentree.py uses some python2.7 specific syntax. Fixes:

./gentree.py -h
File "./gentree.py", line 72
except OSError, e:
^
SyntaxError: invalid syntax

On distros where /usr/bin/python points to python3.

---
 gentree.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
gentree.py +1 -1
index fef2faf..e43f508 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python2.7
 #
 # Generate the output tree into a specified directory.
 #
Signature · 1 line
1.8.3
#1 lore raw

Hi,

Quoted 9 lines · On Sun, 2 Jun 2013 16:12:13 -0700 Thomas Pedersen <[email protected]> wrote:

Apparently gentree.py uses some python2.7 specific syntax. Fixes:

./gentree.py -h
File "./gentree.py", line 72
except OSError, e:
^
SyntaxError: invalid syntax

On distros where /usr/bin/python points to python3.

FYI, on ArchLinux, /usr/bin/python is 3.0, and the old Python (installed by the package python2) uses /usr/bin/python2.

--
I am ... 5 dog years old.

#2 lore raw

Hello,

Quoted 11 lines · Anh K. Huynh
Quoted 8 lines · On Sun, 2 Jun 2013 16:12:13 -0700 Thomas Pedersen <[email protected]> wrote:

Apparently gentree.py uses some python2.7 specific syntax. Fixes:

./gentree.py -h
File "./gentree.py", line 72
except OSError, e:
^
SyntaxError: invalid syntax

Quoted 4 lines
Quoted 1 line

On distros where /usr/bin/python points to python3.

FYI, on ArchLinux, /usr/bin/python is 3.0, and the old Python (installed by the package python2) uses /usr/bin/python2.

python2.7 is also provided by the python2 package. Do you think asking for python2 is a more portable solution?

--
Thomas

#3 lore raw
Quoted 5 lines · On Sun, 2 Jun 2013 20:16:48 -0700 Thomas Pedersen <[email protected]> wrote:
Quoted 2 lines

FYI, on ArchLinux, /usr/bin/python is 3.0, and the old Python (installed by the package python2) uses /usr/bin/python2.

python2.7 is also provided by the python2 package. Do you think asking for python2 is a more portable solution?

Yes on ArchLinux /usr/bin/python2 is a symbolic link of /usr/bin/python2.7.

Unless the script gentree.py requires python2.7 strictly I think that using python2 is more portable. CentOS is still using python2.6 [1].

[1] http://mirror.centos.org/centos/6.4/os/x86_64/Packages/python-2.6.6-36.el6.i686.rpm

--
I am ... 5 dog years old.

#4 lore raw
In reply to Thomas Pedersen
Quoted 5 lines · Thomas Pedersen

Apparently gentree.py uses some python2.7 specific syntax. Fixes:

./gentree.py -h
File "./gentree.py", line 72
except OSError, e:

This is curious, it already uses

except OSError as e:

in most places, just not this one.

I think we should just make this compatible with both 2.7+ and 3, which shouldn't be too hard. I tried a bit and the patchlib is the biggest issue, will try some more after all my meetings.

johannes