Commit 0de1f854 authored by Aurel's avatar Aurel

more BBB for wsgipublisher when it is zope2

parent 3105f098
...@@ -15,8 +15,12 @@ import ZConfig ...@@ -15,8 +15,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):
......
...@@ -469,5 +469,8 @@ def publish_module(environ, start_response, ...@@ -469,5 +469,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