Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
d3ad78e1
Commit
d3ad78e1
authored
Aug 14, 2008
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed integration of Hotfix-2008-08-12
parent
1f87de6f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
lib/python/Products/PythonScripts/PythonScript.py
lib/python/Products/PythonScripts/PythonScript.py
+5
-1
lib/python/Products/PythonScripts/tests/testPythonScript.py
lib/python/Products/PythonScripts/tests/testPythonScript.py
+8
-0
No files found.
lib/python/Products/PythonScripts/PythonScript.py
View file @
d3ad78e1
...
...
@@ -323,7 +323,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
)
...
...
lib/python/Products/PythonScripts/tests/testPythonScript.py
View file @
d3ad78e1
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment