* ubuntutools/lp/libsupport.py: Fail if we're unable to import launchpadlib

(we need it to run stuff).
This commit is contained in:
Jonathan Davies 2009-05-27 16:48:32 -04:00
parent d131a9d995
commit 2e747436a7

View File

@ -21,14 +21,19 @@
# Modules. # Modules.
import glob import glob
import os import os
import sys
import urllib import urllib
import urlparse import urlparse
import httplib2
try: try:
import httplib2
from launchpadlib.credentials import Credentials from launchpadlib.credentials import Credentials
from launchpadlib.launchpad import Launchpad, STAGING_SERVICE_ROOT, EDGE_SERVICE_ROOT from launchpadlib.launchpad import Launchpad, STAGING_SERVICE_ROOT, EDGE_SERVICE_ROOT
from launchpadlib.errors import HTTPError from launchpadlib.errors import HTTPError
except ImportError: except ImportError:
print "Unable to import launchpadlib module, is python-launchpadlib installed?"
sys.exit(1)
except:
Credentials = None Credentials = None
Launchpad = None Launchpad = None