summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-07-06 12:07:36 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2011-07-06 12:07:36 -0400
commit138774b234457bde1af522062be74403d71ea7d9 (patch)
tree0ee02735ab596bbc380729b982bb66a3bac5bd5b
parentb370de69eb0682a822970225c5c46584fae440a2 (diff)
downloadsqlalchemy-138774b234457bde1af522062be74403d71ea7d9.tar.gz
- fix up the invalidate on connect for py3k
- fix the test for separately installed pysqlite
-rw-r--r--lib/sqlalchemy/engine/strategies.py8
-rw-r--r--test/engine/test_parseconnect.py3
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/sqlalchemy/engine/strategies.py b/lib/sqlalchemy/engine/strategies.py
index 528bc3175..b9a1671ec 100644
--- a/lib/sqlalchemy/engine/strategies.py
+++ b/lib/sqlalchemy/engine/strategies.py
@@ -81,12 +81,16 @@ class DefaultEngineStrategy(EngineStrategy):
except Exception, e:
# Py3K
#raise exc.DBAPIError.instance(None, None,
- # e, dialect.dbapi.Error) from e
+ # e, dialect.dbapi.Error,
+ # connection_invalidated=
+ # dialect.is_disconnect(e, None, None)
+ # ) from e
# Py2K
import sys
raise exc.DBAPIError.instance(
None, None, e, dialect.dbapi.Error,
- connection_invalidated=dialect.is_disconnect(e, None, None)), \
+ connection_invalidated=
+ dialect.is_disconnect(e, None, None)), \
None, sys.exc_info()[2]
# end Py2K
diff --git a/test/engine/test_parseconnect.py b/test/engine/test_parseconnect.py
index 1c1ab6aad..ef15cde9f 100644
--- a/test/engine/test_parseconnect.py
+++ b/test/engine/test_parseconnect.py
@@ -232,7 +232,8 @@ pool_timeout=10
# "Cannot operate on a closed database." error
# on connect. IRL we'd be getting Oracle's "shutdown in progress"
- import sqlite3
+ e = create_engine('sqlite://')
+ sqlite3 = e.dialect.dbapi
class ThrowOnConnect(MockDBAPI):
dbapi = sqlite3
Error = sqlite3.Error