~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzr

  • Committer: Martin Pool
  • Date: 2005-09-29 05:06:14 UTC
  • mto: (1185.12.2) (1393.1.12)
  • mto: This revision was merged to the branch mainline in revision 1396.
  • Revision ID: mbp@sourcefrog.net-20050929050614-a41e6f72af36bb4c
- better error on failing to import bzrlib

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
if hasattr(os, "unsetenv"):
44
44
    os.unsetenv(REINVOKE)
45
45
 
46
 
import bzrlib
47
 
import bzrlib.commands
48
 
import bzrlib.trace
 
46
try:
 
47
    import bzrlib
 
48
    import bzrlib.commands
 
49
    import bzrlib.trace
 
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"
 
54
                     "\n")
 
55
    raise
49
56
 
50
57
if __name__ == '__main__':
51
58
    bzrlib.trace.enable_default_logging()
52
59
    sys.exit(bzrlib.commands.main(sys.argv))
 
60
else:
 
61
    pass    # should this give an error? - it can't be used as a lib