summaryrefslogtreecommitdiff
path: root/paste
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-04-21 23:01:37 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-04-21 23:01:37 +0200
commit891f4b68474797d747d4b78eb2ef53c5e440f802 (patch)
treec9eae152b6207da0ae41f2e2fd9222b18144be80 /paste
parent26186eace02105067fe931db3f37b3dab94f619e (diff)
downloadpaste-891f4b68474797d747d4b78eb2ef53c5e440f802.tar.gz
Revert changeset 9f19797dffaa to fix test_registry
Reverted change: "Don't penalize streaming applications"
Diffstat (limited to 'paste')
-rw-r--r--paste/registry.py15
1 files changed, 4 insertions, 11 deletions
diff --git a/paste/registry.py b/paste/registry.py
index 1148632..c240c53 100644
--- a/paste/registry.py
+++ b/paste/registry.py
@@ -373,18 +373,11 @@ class RegistryManager(object):
app_iter = None
reg = environ.setdefault('paste.registry', Registry())
reg.prepare()
- #if self.streaming:
- # return self.streaming_iter(reg, environ, start_response)
+ if self.streaming:
+ return self.streaming_iter(reg, environ, start_response)
try:
app_iter = self.application(environ, start_response)
- #print("REG ", type(app_iter))
- if isinstance(app_iter, (list, tuple)):
- #print("DIRECT")
- return app_iter
- #print("STREAMING")
- return self.streaming_iter(app_iter, reg, environ)
-
except Exception as e:
# Regardless of if the content is an iterable, generator, list
# or tuple, we clean-up right now. If its an iterable/generator
@@ -412,9 +405,9 @@ class RegistryManager(object):
return app_iter
- def streaming_iter(self, app_iter, reg, environ):
+ def streaming_iter(self, reg, environ, start_response):
try:
- for item in app_iter:
+ for item in self.application(environ, start_response):
yield item
except Exception as e:
# Regardless of if the content is an iterable, generator, list