summaryrefslogtreecommitdiff
path: root/paste/registry.py
diff options
context:
space:
mode:
authorbbangert <devnull@localhost>2006-08-10 00:29:12 +0000
committerbbangert <devnull@localhost>2006-08-10 00:29:12 +0000
commitc31b368bfbed0f4c542fb74645ec182520aa16b1 (patch)
treee37fcd6771051d45794081649de4c1d2be3d8076 /paste/registry.py
parent0682981dc88574d02f99280643f64e86b46561f4 (diff)
downloadpaste-c31b368bfbed0f4c542fb74645ec182520aa16b1.tar.gz
Fixed issue with attempting to clean-up the Registry environment twice under certain exception tossing conditions.
Diffstat (limited to 'paste/registry.py')
-rw-r--r--paste/registry.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/paste/registry.py b/paste/registry.py
index 0c54c18..a575cd3 100644
--- a/paste/registry.py
+++ b/paste/registry.py
@@ -277,13 +277,12 @@ class RegistryManager(object):
try:
app_iter = self.application(environ, start_response)
finally:
- if app_iter is None:
- # An error occurred...
- reg.cleanup()
+ if hasattr(app_iter, 'close'):
+ app_iter.close()
+ # 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()
- # 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