]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Connection.invalidate() checks for closed status
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 11 Dec 2008 17:39:01 +0000 (17:39 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 11 Dec 2008 17:39:01 +0000 (17:39 +0000)
to avoid attribute errors. [ticket:1246]

CHANGES
lib/sqlalchemy/engine/base.py

diff --git a/CHANGES b/CHANGES
index a9a9edd9912db4d7bdc8074382dbf81dbe077779..f0b3b18f12d93a1eb541a657f0a0b66c7f651719 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -113,6 +113,9 @@ CHANGES
       __eq__().  If the object does not implement 
       __eq__() and mutable=True, a deprecation warning
       is raised.
+    
+    - Connection.invalidate() checks for closed status 
+      to avoid attribute errors. [ticket:1246]
       
     - Fixed the import weirdness in sqlalchemy.sql
       to not export __names__ [ticket:1215].
index 3a0c1af182eb9b53086edb3723d346cc36a3f609..df9cfa7295554a1a6e69b5d4c6617e324a9e7b64 100644 (file)
@@ -623,6 +623,8 @@ class Connection(Connectable):
         operations in a non-transactional state.
 
         """
+        if self.closed:
+            raise exc.InvalidRequestError("This Connection is closed")
 
         if self.__connection.is_valid:
             self.__connection.invalidate(exception)