Index: subversion/bindings/swig/python/svn/core.py
===================================================================
--- subversion/bindings/swig/python/svn/core.py (revision 17941)
+++ subversion/bindings/swig/python/svn/core.py (working copy)
@@ -189,7 +189,7 @@
   # app tries to destroy a pool during the shutdown process. Instead, we
   # check to make sure the application_pool is still around before calling
   # pool.destroy().
-  if application_pool:
+  if application_pool and application_pool.valid():
     pool.destroy()
 apr_pool_destroy = svn_pool_destroy

