Spaces:
Runtime error
Runtime error
Fiexd a minor bug
Browse files473 unmodified lines47447547647747847948048124 unmodified lines50650750850951051151215 unmodified lines528529530531532533473 unmodified lines# Disable functionalities that can make destructive changes to the test.reliability_guard()print(allowed_imports, allow_str_format, allow_underscore_variable_names)# Run program.try:builtins = {}24 unmodified linesif allow_str_format:exec_globals['getattr'] = safer_getattr_allowing_string_format # type: ignoreexec_globals['__builtins__']['getattr'] = safer_getattr_allowing_string_formatif '__metaclass__' not in exec_globals:exec_globals['__metaclass__'] = type # type: ignore15 unmodified linesif 'getattr' not in exec_globals:exec_globals['getattr'] = safer_getattr # type: ignoreif '_write_' not in exec_globals:exec_globals['_write_'] = _default_write_ # type: ignore473 unmodified lines47447547647747847924 unmodified lines50450550650750850951015 unmodified lines526527528529530531532473 unmodified lines# Disable functionalities that can make destructive changes to the test.reliability_guard()# Run program.try:builtins = {}24 unmodified linesif allow_str_format:exec_globals['getattr'] = safer_getattr_allowing_string_format # type: ignoreexec_globals['__builtins__']['_getattr_'] = safer_getattr_allowing_string_formatif '__metaclass__' not in exec_globals:exec_globals['__metaclass__'] = type # type: ignore15 unmodified linesif 'getattr' not in exec_globals:exec_globals['getattr'] = safer_getattr # type: ignoreexec_globals['__builtins__']['_getattr_'] = safer_getattrif '_write_' not in exec_globals:exec_globals['_write_'] = _default_write_ # type: ignore
restrictedpython_code_eval.py+2-3