]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- [bug] Added a boolean check for the "finalize"
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 28 Jan 2012 02:19:26 +0000 (21:19 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 28 Jan 2012 02:19:26 +0000 (21:19 -0500)
function within the pool connection proxy's
weakref callback before calling it, so that a
warning isn't emitted that this function is None
when the application is exiting and gc has
removed the function from the module before the
weakref callback was invoked.  [ticket:2383]

CHANGES
lib/sqlalchemy/pool.py

diff --git a/CHANGES b/CHANGES
index 35c61afd4039d693821e9e5627cd09e347ba2092..7c3c6b9f7e0bd8308a4ec67d4b4264d98ffc8274 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -128,6 +128,14 @@ CHANGES
     can cause test failures on some platforms.
     [ticket:2379]
 
+  - [bug] Added a boolean check for the "finalize"
+    function within the pool connection proxy's
+    weakref callback before calling it, so that a 
+    warning isn't emitted that this function is None 
+    when the application is exiting and gc has
+    removed the function from the module before the 
+    weakref callback was invoked.  [ticket:2383]
+
 - Py3K
   - [bug] Fixed inappropriate usage of util.py3k
     flag and renamed it to util.py3k_warning, since 
index 7b87cafa941e3cfc0c70cd90634c3575c95933e9..a615e8c606c63c4aa0959ba52ba1abb20be69102 100644 (file)
@@ -372,7 +372,7 @@ class _ConnectionFairy(object):
             conn = self.connection = self._connection_record.get_connection()
             rec.fairy = weakref.ref(
                             self, 
-                            lambda ref:_finalize_fairy(conn, rec, pool, ref, _echo)
+                            lambda ref:_finalize_fairy and _finalize_fairy(conn, rec, pool, ref, _echo)
                         )
             _refs.add(rec)
         except: