Commit f6f8723d authored by Aurel's avatar Aurel Committed by Arnaud Fontaine

more BBB for wsgipublisher when it is zope2

parent 91af6f41
...@@ -20,8 +20,12 @@ import ZConfig ...@@ -20,8 +20,12 @@ import ZConfig
import Zope2 import Zope2
from Zope2.Startup.run import make_wsgi_app from Zope2.Startup.run import make_wsgi_app
from ZPublisher.WSGIPublisher import publish_module try:
from ZPublisher.WSGIPublisher import _MODULES
from ZPublisher.WSGIPublisher import publish_module
except ImportError:
# BBB Zope2
from Products.ERP5Type.patches.WSGIPublisher import publish_module
# this class licensed under the MIT license (stolen from pyramid_translogger) # this class licensed under the MIT license (stolen from pyramid_translogger)
class TransLogger(object): class TransLogger(object):
......
...@@ -495,5 +495,8 @@ def publish_module(environ, start_response, ...@@ -495,5 +495,8 @@ def publish_module(environ, start_response,
# Return the result body iterable. # Return the result body iterable.
return result return result
try:
#sys.modules['ZPublisher.WSGIPublisher'] = sys.modules[__name__] from ZPublisher.WSGIPublisher import _MODULES
except ImportError:
# BBB Zope2
sys.modules['ZPublisher.WSGIPublisher'] = sys.modules[__name__]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment