#1 Force python3 during build process
Opened 4 years ago by senderek. Modified 4 years ago
rpms/ senderek/jack-audio-connection-kit master  into  master

No commits found

This pull request switches to python3 during the build process. Fortunately upstream have already made sure, that the python scripts can be executed correctly with python3 (with one exception, see below) which is the right thing to do if you want to distribute your code to different OSes.

As we can expect upstream to stick to the "#!/usr/bin/env python" line and let the OS decide which python to use, in Fedora we have to switch the first line in every python script to /usr/bin/python3, which is what the additional script "force_python3" does.

The only line of code that is incompatible with python3 is line 540 in waflib/Node.py. Here the recursive function is terminated with a "raise StopIteration" exception, that works fine under python2, but causes a runtime error in python3 which is not intended here. Since Python 3.5 the StopIteration exception
is transformed into a RuntimeError (PEP479), so in order to terminate the recursive function it can safely be replaced with an ordinary return statement.