[Checkins] SVN: Products.CMFCore/trunk/Products/CMFCore/FSPythonScript.py - merging these changes from PythonScript should not hurt

Yvo Schubbe y.2009 at wcm-solutions.de
Mon Jul 27 03:39:14 EDT 2009


Log message for revision 102326:
  - merging these changes from PythonScript should not hurt

Changed:
  U   Products.CMFCore/trunk/Products/CMFCore/FSPythonScript.py

-=-
Modified: Products.CMFCore/trunk/Products/CMFCore/FSPythonScript.py
===================================================================
--- Products.CMFCore/trunk/Products/CMFCore/FSPythonScript.py	2009-07-27 07:31:54 UTC (rev 102325)
+++ Products.CMFCore/trunk/Products/CMFCore/FSPythonScript.py	2009-07-27 07:39:14 UTC (rev 102326)
@@ -182,14 +182,17 @@
             g.update(bound_names)
         g['__traceback_supplement__'] = (
             PythonScriptTracebackSupplement, self, -1)
-        g['__file__'] = self._filepath
+        g['__file__'] = getattr(self, '_filepath', None) or self.get_filepath()
         if f.func_defaults:
             f = new.function(f.func_code, g, f.func_name,
                              f.func_defaults)
         else:
             f = new.function(f.func_code, g, f.func_name)
 
-        result = f(*args, **kw)
+        try:
+            result = f(*args, **kw)
+        except SystemExit:
+            raise ValueError('SystemExit cannot be raised within a PythonScript')
 
         if keyset is not None:
             # Store the result in the cache.



More information about the Checkins mailing list