Commit d3ad78e1 authored by Andreas Jung's avatar Andreas Jung

fixed integration of Hotfix-2008-08-12

parent 1f87de6f
...@@ -323,7 +323,11 @@ class PythonScript(Script, Historical, Cacheable): ...@@ -323,7 +323,11 @@ class PythonScript(Script, Historical, Cacheable):
g['__file__'] = getattr(self, '_filepath', None) or self.get_filepath() g['__file__'] = getattr(self, '_filepath', None) or self.get_filepath()
f = new.function(fcode, g, None, fadefs) f = new.function(fcode, g, None, fadefs)
result = f(*args, **kw) try:
result = f(*args, **kw)
except SystemExit:
raise ValueError('SystemExit can not be raised within a PythonScript')
if keyset is not None: if keyset is not None:
# Store the result in the cache. # Store the result in the cache.
self.ZCacheable_set(result, keywords=keyset) self.ZCacheable_set(result, keywords=keyset)
......
...@@ -211,6 +211,14 @@ class TestPythonScriptNoAq(PythonScriptTestBase): ...@@ -211,6 +211,14 @@ class TestPythonScriptNoAq(PythonScriptTestBase):
f = self._filePS('complex_print') f = self._filePS('complex_print')
self.assertEqual(f.get_size(), len(f.read())) self.assertEqual(f.get_size(), len(f.read()))
def testRaiseSystemExitLaunchpad257269(self):
ps = self._newPS("raise SystemExit")
self.assertRaises(ValueError, ps)
def testEncodingTestDotTestAllLaunchpad257276(self):
ps = self._newPS("return 'foo'.encode('test.testall')")
self.assertRaises(LookupError, ps)
class TestPythonScriptErrors(PythonScriptTestBase): class TestPythonScriptErrors(PythonScriptTestBase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment