16
17
# along with this program; if not, write to the Free Software
17
18
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
version_info = sys.version_info
23
except AttributeError:
24
version_info = 1, 5 # 1.5 or older
27
REINVOKE = "__BZR_REINVOKE"
29
KNOWN_PYTHONS = ('python2.4',)
31
if version_info < NEED_VERS:
32
if not os.environ.has_key(REINVOKE):
33
# mutating os.environ doesn't work in old Pythons
34
os.putenv(REINVOKE, "1")
35
for python in KNOWN_PYTHONS:
37
os.execvp(python, [python] + sys.argv)
40
print >>sys.stderr, "bzr: error: cannot find a suitable python interpreter"
41
print >>sys.stderr, " (need %d.%d or later)" % NEED_VERS
43
if hasattr(os, "unsetenv"):
48
import bzrlib.commands
50
except ImportError, e:
51
sys.stderr.write("bzr: ERROR: "
52
"Couldn't import bzrlib and dependencies.\n"
53
"Please check bzrlib is on your PYTHONPATH.\n"
20
import sys, bzrlib, bzrlib.commands
57
23
if __name__ == '__main__':
58
bzrlib.trace.enable_default_logging()
59
24
sys.exit(bzrlib.commands.main(sys.argv))
61
pass # should this give an error? - it can't be used as a lib