On Sun, 04 Dec 2005, djames@tigris.org wrote:
...
> Log:
> * subversion/bindings/swig/python/svn/core.py
> (svn_pool_destroy, svn_pool_clear): Check whether pools are valid before
> working with them. This change prevents assertion failures when Subversion
> 1.2.x applications try to destroy pools during application shutdown, when
> the validity of the pool is not guaranteed. Subversion 1.2.x applications
> can't call "pool.valid()" themselves to check the validity of pools, because
> it's a new API in Subversion 1.3.x.
>
> Notes: Fixes warnings about assertion failures in the test suite for
> Trac 0.9.x
...
> --- trunk/subversion/bindings/swig/python/svn/core.py (original)
> +++ trunk/subversion/bindings/swig/python/svn/core.py Sun Dec 4 12:26:42 2005
> @@ -185,7 +185,8 @@
> assert pool is not None
>
> if hasattr(pool,"destroy"):
> - pool.destroy()
> + if pool.valid():
> + pool.destroy()
> else:
> _core.apr_pool_destroy(pool)
> apr_pool_destroy = svn_pool_destroy
> @@ -198,7 +199,8 @@
> assert pool is not None
>
> if hasattr(pool,"clear"):
> - pool.clear()
> + if pool.valid():
> + pool.clear()
> else:
> _core.apr_pool_clear(pool)
> apr_pool_clear = svn_pool_clear
If the pool has a clear() or destroy() method, but is not valid(), it
is okay to call neither the instance method nor _core's
apr_pool_destroy()/apr_pool_clear() function? Otherwise, the
conditionals could be AND'd instead of using a nested "if".
--
Daniel Rall
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Dec 5 21:29:50 2005