[Zope3-checkins] SVN: Zope3/branches/stephan_and_jim-response-refactor/src/zope/publisher/base.py Added backward compatibility for old construction api.

Jim Fulton jim at zope.com
Fri Sep 2 17:35:50 EDT 2005


Log message for revision 38268:
  Added backward compatibility for old construction api.
  

Changed:
  U   Zope3/branches/stephan_and_jim-response-refactor/src/zope/publisher/base.py

-=-
Modified: Zope3/branches/stephan_and_jim-response-refactor/src/zope/publisher/base.py
===================================================================
--- Zope3/branches/stephan_and_jim-response-refactor/src/zope/publisher/base.py	2005-09-02 21:22:43 UTC (rev 38267)
+++ Zope3/branches/stephan_and_jim-response-refactor/src/zope/publisher/base.py	2005-09-02 21:35:49 UTC (rev 38268)
@@ -410,9 +410,19 @@
 
     __slots__ = ('_presentation_type', )
 
-    def __init__(self, path, body_instream=None, environ=None):
+    def __init__(self, path, body_instream=None, environ=None, outstream=None):
+
+        # XXX BBB
         if environ is None:
             environ = {}
+        else:
+            if not hasattr(environ, 'get'):
+                import warnings
+                warnings.warn("Can't pass output streams to requests anymore",
+                              DeprecationWarning,
+                              2)
+                environ = outstream
+                
         environ['PATH_INFO'] = path
         if body_instream is None:
             body_instream = StringIO('')



More information about the Zope3-Checkins mailing list