]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
tabs->spaces ! (also relies upon '2' being present in version id)
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 10 Jan 2006 02:30:54 +0000 (02:30 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 10 Jan 2006 02:30:54 +0000 (02:30 +0000)
lib/sqlalchemy/databases/postgres.py

index 6b1dbef465c0cf3f59578f5230fefa7f43252076..539cd35d09f45723c51f6027424ccc935a06a8c9 100644 (file)
@@ -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)