diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-01-10 02:30:54 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-01-10 02:30:54 +0000 |
| commit | d8c8240f2d23010cdc99db2cf51cd60a956e50ba (patch) | |
| tree | 0b29a9f9da1fa9339b2613fde5908175c8621686 /lib/sqlalchemy/databases/postgres.py | |
| parent | ac5e13ef2d6129e17bbd5c1e238dee91aa10cf47 (diff) | |
| download | sqlalchemy-d8c8240f2d23010cdc99db2cf51cd60a956e50ba.tar.gz | |
tabs->spaces ! (also relies upon '2' being present in version id)
Diffstat (limited to 'lib/sqlalchemy/databases/postgres.py')
| -rw-r--r-- | lib/sqlalchemy/databases/postgres.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 6b1dbef46..539cd35d0 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -118,16 +118,13 @@ class PGSQLEngine(ansisql.ANSISQLEngine): else: self.module = module # figure psycopg version 1 or 2 - try: - if self.module.__version__.startswith('2'): - self.version = 2 - else: - self.version = 1 - except: - if self.module.__name__.endswith('psycopg2'): - self.version = 2 - else: - self.version = 1 + try: + if self.module.__version__.startswith('2'): + self.version = 2 + else: + self.version = 1 + except: + self.version = 1 self.opts = opts or {} ansisql.ANSISQLEngine.__init__(self, **params) |
