[Zope-Checkins] CVS: Zope2 - VSExec.py:1.5.24.3
evan@serenade.digicool.com
evan@serenade.digicool.com
Thu, 8 Mar 2001 18:08:42 -0500
Update of /cvs-repository/Zope2/lib/python/Products/PythonScripts/zbytecodehacks
In directory serenade:/slab/home/evan/Zope/psfix/lib/python/Products/PythonScripts/zbytecodehacks
Modified Files:
Tag: evan-script_fix-branch
VSExec.py
Log Message:
Fixed printing bug, added unit tests for the bug.
--- Updated File VSExec.py in package Zope2 --
--- VSExec.py 2001/02/23 23:27:47 1.5.24.2
+++ VSExec.py 2001/03/08 23:08:42 1.5.24.3
@@ -417,13 +417,10 @@
def _wrap(w):
load_guard = ((ops.LOAD_FAST,), ((guard,),))
# Load the guard function before the guarded object, call after.
- w.insert_code(load_guard, w.before_code_for(spos))
- if spos == 0:
- w.set_code(0, cf1)
- else:
- iops = w.insert_code(cf1, w.after_code_for(spos))
- # Fix the execution stack.
- if w.use_stack: w.stack[spos] = (w.stack[spos][0], iops[0])
+ iops1 = w.insert_code(load_guard, w.before_code_for(spos))
+ iops2 = w.insert_code(cf1, w.after_code_for(spos))
+ # Fix the execution stack.
+ if w.use_stack: w.stack[spos] = (iops1[0], iops2[0])
def _WriteGuardWrapper():
def model_handler(self, *args):