diff options
| author | Marko Kreen | 2007-09-17 09:04:21 +0000 |
|---|---|---|
| committer | Marko Kreen | 2007-09-17 09:04:21 +0000 |
| commit | 9d0ef2d5035ef98624f7c605826ff41dd0dd8f76 (patch) | |
| tree | 661733291c945a54dd23a5c5391c47a8284630b3 /python/skytools | |
| parent | 2ae52135e25bac13c56ac77914ce254c59a30db6 (diff) | |
clearer error message for missing psycopg
Diffstat (limited to 'python/skytools')
| -rw-r--r-- | python/skytools/psycopgwrapper.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/python/skytools/psycopgwrapper.py b/python/skytools/psycopgwrapper.py index c15ee1e8..2127f950 100644 --- a/python/skytools/psycopgwrapper.py +++ b/python/skytools/psycopgwrapper.py @@ -76,8 +76,12 @@ try: except ImportError: # use psycopg 1 - from psycopg import connect as _pgconnect - from psycopg import QuotedString + try: + from psycopg import connect as _pgconnect + from psycopg import QuotedString + except ImportError: + print "Please install psycopg2 module" + sys.exit(1) def connect_database(connstr): """Create a db connection with connect_timeout option. |
