server/serverctl.py
changeset 7577 9892937d9041
parent 7569 02c338197322
child 7595 83872394b5d9
--- a/server/serverctl.py	Wed Jun 29 16:13:09 2011 +0200
+++ b/server/serverctl.py	Wed Jun 29 18:26:29 2011 +0200
@@ -123,11 +123,10 @@
                             interactive=interactive)
     # disable autocommit (isolation_level(1)) because DROP and
     # CREATE DATABASE can't be executed in a transaction
-    try:
-        cnx.set_isolation_level(0)
-    except AttributeError:
+    set_isolation_level = getattr(cnx, 'set_isolation_level', None)
+    if set_isolation_level is not None:
         # set_isolation_level() is psycopg specific
-        pass
+        set_isolation_level(0)
     return cnx
 
 def repo_cnx(config):