Commit 87f18e5a authored by Andreas Jung's avatar Andreas Jung

fixed integration of Hotfix-2008-08-08

parent ab9a5ffb
......@@ -324,7 +324,11 @@ class PythonScript(Script, Historical, Cacheable):
g['__file__'] = getattr(self, '_filepath', None) or self.get_filepath()
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:
# Store the result in the cache.
self.ZCacheable_set(result, keywords=keyset)
......
......@@ -211,6 +211,14 @@ class TestPythonScriptNoAq(PythonScriptTestBase):
f = self._filePS('complex_print')
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):
......
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