summaryrefslogtreecommitdiff
path: root/paste/registry.py
diff options
context:
space:
mode:
authorbbangert <devnull@localhost>2006-08-09 23:03:37 +0000
committerbbangert <devnull@localhost>2006-08-09 23:03:37 +0000
commit0682981dc88574d02f99280643f64e86b46561f4 (patch)
tree261ab3d5b752d27e7f93b31078cef1d1a11cc4b6 /paste/registry.py
parentd0511af79dbc85d981d9db94b8bdfc0f5e2410b0 (diff)
downloadpaste-0682981dc88574d02f99280643f64e86b46561f4.tar.gz
Fixed issue with Registry still referring to the wrong place if an app down the chain uses Registry and returns an iter. Apps returning iter's should hold their own ref to any objects that used a StackedObjectProxy.
Diffstat (limited to 'paste/registry.py')
-rw-r--r--paste/registry.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/paste/registry.py b/paste/registry.py
index a802856..0c54c18 100644
--- a/paste/registry.py
+++ b/paste/registry.py
@@ -280,14 +280,10 @@ class RegistryManager(object):
if app_iter is None:
# An error occurred...
reg.cleanup()
- if type(app_iter) in (list, tuple):
- # Because it is a concrete iterator (not a generator) we
- # know the configuration for this thread is no longer
- # needed:
- reg.cleanup()
- return app_iter
- else:
- new_app_iter = wsgilib.add_close(app_iter, reg.cleanup)
- return new_app_iter
-
-
+
+ # Regardless of if the content is an iterable, generator, list
+ # or tuple, we clean-up right now. If its an iterable/generator
+ # care should be used to ensure the generator has its own ref
+ # to the actual object
+ reg.cleanup()
+ return app_iter