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
a0ac19ae
Commit
a0ac19ae
authored
Sep 27, 1999
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replaced Python's dangerous pow with a safe pow.
parent
a8f9f357
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
lib/python/DocumentTemplate/DT_Util.py
lib/python/DocumentTemplate/DT_Util.py
+11
-3
No files found.
lib/python/DocumentTemplate/DT_Util.py
View file @
a0ac19ae
...
...
@@ -82,8 +82,8 @@
# attributions are listed in the accompanying credits file.
#
##############################################################################
'''$Id: DT_Util.py,v 1.5
8 1999/08/24 16:48:43
jim Exp $'''
__version__
=
'$Revision: 1.5
8
$'
[
11
:
-
2
]
'''$Id: DT_Util.py,v 1.5
9 1999/09/27 13:14:15
jim Exp $'''
__version__
=
'$Revision: 1.5
9
$'
[
11
:
-
2
]
import
regex
,
string
,
math
,
os
from
string
import
strip
,
join
,
atoi
,
lower
,
split
,
find
...
...
@@ -207,12 +207,20 @@ except: from pDocumentTemplate import InstanceDict, TemplateDict, render_blocks
d
=
TemplateDict
.
__dict__
for
name
in
(
'None'
,
'abs'
,
'chr'
,
'divmod'
,
'float'
,
'hash'
,
'hex'
,
'int'
,
'len'
,
'max'
,
'min'
,
'oct'
,
'ord'
,
'
pow'
,
'
round'
,
'str'
):
'len'
,
'max'
,
'min'
,
'oct'
,
'ord'
,
'round'
,
'str'
):
d
[
name
]
=
__builtins__
[
name
]
d
[
'string'
]
=
string
d
[
'math'
]
=
math
d
[
'whrandom'
]
=
whrandom
def
careful_pow
(
self
,
x
,
y
,
z
):
if
not
z
:
raise
ValueError
,
'pow(x, y, z) with z==0'
return
pow
(
x
,
y
,
z
)
d
[
'pow'
]
=
careful_pow
try
:
import
random
d
[
'random'
]
=
random
...
...
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