[PATCH] python version check
fredrik at pythonware.com
Fri Apr 15 22:25:09 BST 2005
> here's a patch for the bzr start script that checks the python version. if
> the current interpreter is older than 2.3, it attempts to hand control over
> to a more modern interpreter.
> this has been tested with 1.5.2 and newer.
> (feel free to improve the error message, btw)
> enjoy! /F
*** modified file 'bzr'
@@ -17,9 +17,23 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-import sys, bzrlib, bzrlib.commands
+import os, sys
+ version_info = sys.version_info
+ version_info = 1, 5 # 1.5 or older
+if version_info < (2, 3):
+ for python in 'python2.4', 'python2.3':
+ os.execvp(python, [python] + sys.argv)
+ except OSError:
+ print "***", "cannot find a suitable python interpreter"
+import bzrlib, bzrlib.commands
if __name__ == '__main__':
More information about the bazaar