Skip to content

Commit

Permalink
Merge change to trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Simpson committed Jan 17, 2001
1 parent 98ae112 commit 7313e15
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion PythonScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
Python code.
"""

__version__='$Revision: 1.16 $'[11:-2]
__version__='$Revision: 1.17 $'[11:-2]

import sys, os, traceback, re
from Globals import DTMLFile, MessageDialog
Expand All @@ -104,6 +104,10 @@
from OFS.Cache import Cacheable
from zLOG import LOG, ERROR, INFO

import imp
Python_magic = imp.get_magic()
del imp

manage_addPythonScriptForm = DTMLFile('www/pyScriptAdd', globals())

_marker = [] # Create a new marker object
Expand Down Expand Up @@ -257,11 +261,15 @@ def _newfun(self, allowSideEffect, g, **kws):
fc = f.func_code
self._setFuncSignature(f.func_defaults, fc.co_varnames,
fc.co_argcount)
self.Python_magic = Python_magic
return f

def _makeFunction(self, allowSideEffect=0):
from Guarded import GuardedBlock, theGuard, safebin
from Guarded import WriteGuard, ReadGuard
# Was the cached bytecode compiled with a compatible Python?
if getattr(self, Python_magic, None) != Python_magic:
allowSideEffect = 1
if allowSideEffect:
self._checkCBlock(GuardedBlock)
self.ZCacheable_invalidate()
Expand Down

0 comments on commit 7313e15

Please sign in to comment.