~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzr_man.py

  • Committer: Wouter van Heyst
  • Date: 2005-10-28 19:35:13 UTC
  • mto: (1185.16.143)
  • mto: This revision was merged to the branch mainline in revision 1498.
  • Revision ID: larstiq@larstiq.dyndns.org-20051028193513-4e2c5316dba6c217
Kill the python reinvocation, it doesn't work for me, and
it's moving to be imported from setup.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import os, sys
23
23
 
24
 
try:
25
 
    version_info = sys.version_info
26
 
except AttributeError:
27
 
    version_info = 1, 5 # 1.5 or older
28
 
 
29
 
 
30
 
REINVOKE = "__BZR_REINVOKE"    
31
 
NEED_VERS = (2, 3)
32
 
 
33
 
if version_info < NEED_VERS:
34
 
    if not os.environ.has_key(REINVOKE):
35
 
        # mutating os.environ doesn't work in old Pythons
36
 
        os.putenv(REINVOKE, "1")
37
 
        for python in 'python2.4', 'python2.3':
38
 
            try:
39
 
                os.execvp(python, [python] + sys.argv)
40
 
            except OSError:
41
 
                pass
42
 
    print >>sys.stderr, "bzr-man.py: error: cannot find a suitable python interpreter"
43
 
    print >>sys.stderr, "  (need %d.%d or later)" % NEED_VERS
44
 
    sys.exit(1)
45
 
if hasattr(os, "unsetenv"):
46
 
    os.unsetenv(REINVOKE)
47
 
 
48
24
import bzrlib, bzrlib.help
49
25
 
50
26
#>>> code taken from bzr (C) Canonical