Commit 749484d9 authored by Aurel's avatar Aurel

override the default next guard

parent 4efadad0
...@@ -78,8 +78,10 @@ del safe_builtins['list'] ...@@ -78,8 +78,10 @@ del safe_builtins['list']
add_builtins(Ellipsis=Ellipsis, NotImplemented=NotImplemented, add_builtins(Ellipsis=Ellipsis, NotImplemented=NotImplemented,
dict=dict, list=list) dict=dict, list=list)
BBB_ACCESS_CONTROL = False
if "set" not in safe_builtins: # BBB if "set" not in safe_builtins: # BBB
add_builtins(set=set, frozenset=frozenset, slice=slice) add_builtins(set=set, frozenset=frozenset, slice=slice)
BBB_ACCESS_CONTROL = True
add_builtins(bin=bin, classmethod=classmethod, format=format, object=object, add_builtins(bin=bin, classmethod=classmethod, format=format, object=object,
property=property, staticmethod=staticmethod, property=property, staticmethod=staticmethod,
...@@ -106,10 +108,10 @@ def guarded_next(iterator, default=_marker): ...@@ -106,10 +108,10 @@ def guarded_next(iterator, default=_marker):
if default is _marker: if default is _marker:
raise raise
return default return default
BBB_ACCESS_CONTROL = False #if "next" not in safe_builtins: # BBB
if "next" not in safe_builtins: # BBB # override the default next if exists
add_builtins(next=guarded_next) safe_builtins.update(next=guarded_next)
BBB_ACCESS_CONTROL = True # add_builtins()
_safe_class_attribute_dict = {} _safe_class_attribute_dict = {}
import inspect import inspect
......
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