From d470ad40a66bef308acc29151f803eb317225718 Mon Sep 17 00:00:00 2001 From: ciesiel Date: Thu, 3 Jun 2004 16:45:12 +0000 Subject: [PATCH] - fixed looping product iHotfix Changed files: Zope-iHotfix-loop.patch -> 1.1 --- Zope-iHotfix-loop.patch | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Zope-iHotfix-loop.patch diff --git a/Zope-iHotfix-loop.patch b/Zope-iHotfix-loop.patch new file mode 100644 index 0000000..9d571f8 --- /dev/null +++ b/Zope-iHotfix-loop.patch @@ -0,0 +1,51 @@ +diff -urN oryg/__init__.py zmien/__init__.py +--- oryg/__init__.py 2004-02-27 17:03:24.000000000 +0100 ++++ zmien/__init__.py 2004-06-03 18:30:38.000000000 +0200 +@@ -80,23 +80,33 @@ + contexts[id] = context + + # Publish +- x = Publish.old_publish(zope_request, module_name, after_list, debug) +- +- # Remove the context object + try: ++ x = Publish.old_publish(zope_request, module_name, after_list, debug) ++ except: + del contexts[id] +- except KeyError: +- # Some people has reported that sometimes a KeyError exception is +- # raised in the previous line, I haven't been able to reproduce it. +- # This try/except clause seems to work. I'd prefer to understand +- # what is happening. +- LOG('iHotfix', PROBLEM, +- "The thread number %s don't has a context object associated." % id) +- +- return x +- ++ raise ++ else: ++ # Remove the context object ++ try: ++ del contexts[id] ++ except KeyError: ++ # Some people has reported that sometimes a KeyError exception is ++ # raised in the previous line, I haven't been able to reproduce it. ++ # This try/except clause seems to work. I'd prefer to understand ++ # what is happening. ++ LOG('iHotfix', PROBLEM, ++ "The thread %s doesn't have a context object associated." % id) ++ ++ return x ++ ++ ++if patch is False: ++ # Intercept I18NLayer (XXX it should depend on iHotfix, contact its ++ # authors). ++ if hasattr(Publish, 'old_publish'): ++ Publish.publish = Publish.old_publish ++ del Publish.old_publish + +-if not patch: + # XXX What happens when Localizer 1.0 and iHotfix are installed?? + # Apply the patch + Publish.old_publish = Publish.publish -- 2.43.0