Commit d19753d0 authored by Jérome Perrin's avatar Jérome Perrin

remove some iHotFix references

parent 73594d3c
...@@ -57,17 +57,10 @@ from Zope2 import app ...@@ -57,17 +57,10 @@ from Zope2 import app
from Products.ERP5Type.UnrestrictedMethod import PrivilegedUser from Products.ERP5Type.UnrestrictedMethod import PrivilegedUser
from zope.site.hooks import setSite from zope.site.hooks import setSite
try: import Products.Localizer.patches
from Products import iHotfix localizer_lock = Products.Localizer.patches._requests_lock
localizer_lock = iHotfix._the_lock localizer_contexts = Products.Localizer.patches._requests
localizer_contexts = iHotfix.contexts LocalizerContext = lambda request: request
LocalizerContext = iHotfix.Context
except ImportError:
# Localizer 1.2 includes iHotFix patches
import Products.Localizer.patches
localizer_lock = Products.Localizer.patches._requests_lock
localizer_contexts = Products.Localizer.patches._requests
LocalizerContext = lambda request: request
from ZODB.POSException import ConflictError from ZODB.POSException import ConflictError
......
...@@ -77,28 +77,9 @@ config.product_config['deadlockdebugger'] = {'dump_url':'/manage_debug_threads'} ...@@ -77,28 +77,9 @@ config.product_config['deadlockdebugger'] = {'dump_url':'/manage_debug_threads'}
from Testing.ZopeTestCase.layer import onsetup from Testing.ZopeTestCase.layer import onsetup
try:
# Workaround iHotFix patch that doesn't work with
# ZopeTestCase REQUESTs
from Products import iHotfix
from types import UnicodeType
# revert monkey patchs from iHotfix
iHotfix.get_request = get_request
originalStringIO = iHotfix.originalStringIO
class UnicodeSafeStringIO(originalStringIO):
"""StringIO like class which never fails with unicode."""
def write(self, s):
if isinstance(s, UnicodeType):
s = s.encode('utf8', 'repr')
originalStringIO.write(self, s)
# iHotFix will patch PageTemplate StringIO with
iHotfix.iHotfixStringIO = UnicodeSafeStringIO
except ImportError:
pass
try: try:
# Workaround Localizer >= 1.2 patch that doesn't work with # Workaround Localizer >= 1.2 patch that doesn't work with
# ZopeTestCase REQUESTs (it's the same as iHotFix # ZopeTestCase REQUESTs
from Products.Localizer import patches, utils from Products.Localizer import patches, utils
# revert monkey patches from Localizer # revert monkey patches from Localizer
patches.get_request = get_request patches.get_request = get_request
......
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