Commit 7b33b1af authored by Boxiang Sun's avatar Boxiang Sun

backport to 2.13.2

parent 695ee1d0
...@@ -43,7 +43,7 @@ setup(name='DocumentTemplate', ...@@ -43,7 +43,7 @@ setup(name='DocumentTemplate',
install_requires=[ install_requires=[
'AccessControl', 'AccessControl',
'Acquisition', 'Acquisition',
'ExtensionClass>=4.1a1', 'ExtensionClass',
'RestrictedPython', 'RestrictedPython',
'six', 'six',
'zExceptions', 'zExceptions',
......
...@@ -76,6 +76,9 @@ class NotBindable: ...@@ -76,6 +76,9 @@ class NotBindable:
for name, f in list(safe_builtins.items()) + list(utility_builtins.items()): for name, f in list(safe_builtins.items()) + list(utility_builtins.items()):
if type(f) is functype: if type(f) is functype:
f = NotBindable(f) f = NotBindable(f)
# Pyston change: why it happended in Pyston?
if name is None or f is None:
continue
setattr(TemplateDict, name, f) setattr(TemplateDict, name, f)
if LIMITED_BUILTINS: if LIMITED_BUILTINS:
......
...@@ -121,6 +121,9 @@ for name, v in safe_builtins.items(): ...@@ -121,6 +121,9 @@ for name, v in safe_builtins.items():
v = DT_Util.NotBindable(v) v = DT_Util.NotBindable(v)
if name.startswith('__'): if name.startswith('__'):
continue continue
# Pyston change: why it happened in Pyston?
if name is None or v is None:
continue
setattr(DT_Util.TemplateDict, name, v) setattr(DT_Util.TemplateDict, name, v)
......
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