[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: xreadlines/python2 (?) required for gen-make.py

From: Edward S. Marshall <esm_at_logic.net>
Date: 2002-10-30 03:36:41 CET

On Tue, 2002-10-29 at 15:22, Daniel Rall wrote:
> Yes, it definitely wouldn't work in all configurations. I'm hoping
> someone will come up with a better solution. This isn't a blocking
> problem for me, but was worth bringing up.

I'm going to burn in hell for this one, but how about:

#!/usr/bin/env python
import sys, os
if sys.hexversion < 0x02000000:
    if len(sys.argv) > 1 and sys.argv[-1] == 'bog!':
        print "You need Python 2.0 or greater to use this script."
        sys.exit(1)
    else:
        os.execvp('python2', ['python2'] + sys.argv + ['bog!'])

It ain't pretty, but it works...;-)

-- 
Edward S. Marshall <esm@logic.net>
http://esm.logic.net/

Received on Wed Oct 30 03:37:07 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.