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
57d4b13d
Commit
57d4b13d
authored
Jan 15, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow assertions in Scripts
parent
81e8827b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
lib/python/Products/PythonScripts/Guarded.py
lib/python/Products/PythonScripts/Guarded.py
+4
-4
lib/python/Products/PythonScripts/PythonScript.py
lib/python/Products/PythonScripts/PythonScript.py
+3
-2
lib/python/Products/PythonScripts/zbytecodehacks/VSExec.py
lib/python/Products/PythonScripts/zbytecodehacks/VSExec.py
+1
-1
No files found.
lib/python/Products/PythonScripts/Guarded.py
View file @
57d4b13d
...
...
@@ -83,7 +83,7 @@
#
##############################################################################
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
from
zbytecodehacks.VSExec
import
SafeBlock
,
GuardedBinaryOps
,
\
UntupleFunction
,
RedirectWrites
,
WriteGuard
,
RedirectReads
,
ReadGuard
,
\
...
...
@@ -108,9 +108,9 @@ for name in ('None', 'abs', 'chr', 'divmod', 'float', 'hash', 'hex', 'int',
for
name
in
(
'range'
,
'pow'
,
'DateTime'
,
'test'
,
'namespace'
,
'render'
):
safebin
[
name
]
=
getattr
(
safefuncs
,
name
)
for
name
in
(
'ArithmeticError'
,
'A
ttributeError'
,
'EOF
Error'
,
'E
nvironmentError'
,
'FloatingPointError'
,
'IO
Error'
,
'ImportError'
,
'IndexError'
,
'KeyError'
,
for
name
in
(
'ArithmeticError'
,
'A
ssertionError'
,
'Attribute
Error'
,
'E
OFError'
,
'EnvironmentError'
,
'FloatingPoint
Error'
,
'I
OError'
,
'I
mportError'
,
'IndexError'
,
'KeyError'
,
'LookupError'
,
'NameError'
,
'OSError'
,
'OverflowError'
,
'RuntimeError'
,
'StandardError'
,
'SyntaxError'
,
'TypeError'
,
'ValueError'
,
'ZeroDivisionError'
,
...
...
lib/python/Products/PythonScripts/PythonScript.py
View file @
57d4b13d
...
...
@@ -89,7 +89,7 @@ This product provides support for Script objects containing restricted
Python code.
"""
__version__
=
'$Revision: 1.1
4
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
5
$'
[
11
:
-
2
]
import
sys
,
os
,
traceback
,
re
from
Globals
import
DTMLFile
...
...
@@ -270,7 +270,8 @@ class PythonScript(Script, Historical, Cacheable):
join(self._v_errors, '
\
n
') )
return self._newfun(allowSideEffect, {'
$
guard
': theGuard,
'
$
write_guard
': WriteGuard,
'
$
read_guard
': ReadGuard},
'
$
read_guard
': ReadGuard,
'
__debug__
': __debug__},
__builtins__=safebin)
def _editedBindings(self):
...
...
lib/python/Products/PythonScripts/zbytecodehacks/VSExec.py
View file @
57d4b13d
...
...
@@ -343,7 +343,7 @@ def PublicNames(cb, w, fc):
'''
protected
=
[]
for
name
in
fc
.
co_names
:
if
name
[:
1
]
==
'_'
and
len
(
name
)
>
1
:
if
name
[:
1
]
==
'_'
and
len
(
name
)
>
1
and
name
!=
'__debug__'
:
protected
.
append
(
name
)
if
protected
:
raise
SyntaxError
,
(
'Names starting with "_" are not allowed (%s).'
...
...
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