[Zope3-checkins] CVS: Zope3/src/zope - __init__.py:1.2.60.1

Jim Fulton jim at zope.com
Sun Feb 8 01:39:11 EST 2004


Update of /cvs-repository/Zope3/src/zope
In directory cvs.zope.org:/tmp/cvs-serv21116

Modified Files:
      Tag: zope3-zodb3-devel-branch
	__init__.py 
Log Message:
XXX Evil monkey patch of weakref to avoid a Python 2.3.3 weakref bug that
causes sporadic segfaults


=== Zope3/src/zope/__init__.py 1.2 => 1.2.60.1 ===
--- Zope3/src/zope/__init__.py:1.2	Wed Dec 25 09:12:24 2002
+++ Zope3/src/zope/__init__.py	Sun Feb  8 01:39:10 2004
@@ -1,2 +1,22 @@
 #
 # This file is necessary to make this directory a package.
+
+# XXX Evil monkey patch of weakref to avoid a Python 2.3.3 weakref bug that
+# causes sporadic segfaults
+
+def monkey_patch():
+    import weakref
+    import gc
+    ref = weakref.ref
+    disable = gc.disable
+    enable = gc.enable
+    def monkey_ref(*args, **kw):
+        disable()
+        r = ref(*args, **kw)
+        enable()
+        return r
+
+    weakref.ref = monkey_ref
+
+monkey_patch()
+del monkey_patch




More information about the Zope3-Checkins mailing list