diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-01-27 21:19:26 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-01-27 21:19:26 -0500 |
| commit | 5221f492ca704d75561d7729fba0fa48fd3ad0fb (patch) | |
| tree | 17ac3013241a504f67fd10113f326e8df9d9b631 /lib/sqlalchemy/pool.py | |
| parent | 07130c7a8b5c58e744c27c7b1baabeda7034f05b (diff) | |
| download | sqlalchemy-5221f492ca704d75561d7729fba0fa48fd3ad0fb.tar.gz | |
- [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]
Diffstat (limited to 'lib/sqlalchemy/pool.py')
| -rw-r--r-- | lib/sqlalchemy/pool.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/pool.py b/lib/sqlalchemy/pool.py index 7b87cafa9..a615e8c60 100644 --- a/lib/sqlalchemy/pool.py +++ b/lib/sqlalchemy/pool.py @@ -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: |
