summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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