Module ImportFrom alias alias alias alias ImportFrom alias alias alias alias ImportFrom alias FunctionDef arguments args defaults body Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad If NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad Call NameLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad Expr Call AttributeLoad Call NameLoad NameLoad attr Call AttributeLoad Str attr decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad Str Assign NameStore BinOpAdd NameLoad Call NameLoad Str Expr Call AttributeLoad Call NameLoad attr NameLoad Assign NameStore BinOpAdd NameLoad Call NameLoad Str Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Import alias Assign NameStore Call NameLoad Str Assign NameStore BinOpAdd NameLoad Call NameLoad Str TryExcept body Expr Call AttributeLoad Call NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Assert CompareEq Call NameLoad NameLoad Str Call NameLoad NameLoad orelse Assert NameLoad decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad Str Assign NameStore BinOpAdd NameLoad Call NameLoad Str TryExcept body Expr Call AttributeLoad Call NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Assert CompareEq Call NameLoad NameLoad Str decorator_list FunctionDef arguments args defaults body Assign NameStore Call NameLoad Str Assign NameStore BinOpAdd NameLoad Call NameLoad Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad Call NameLoad NameLoad attr NameLoad decorator_list
N/A sandbox Sandbox SandboxError HAVE_CSANDBOX HAVE_PYPY sandbox.test SkipTest createSandbox createSandboxConfig unindent sys version_info test_call_exec_builtins N/A N/A N/A N/A N/A code N/A unindent 
        result = []
        exec "result.append(type(__builtins__))" in {'result': result}
        builtin_type = result[0]
        assert builtin_type != dict
     N/A config N/A createSandboxConfig N/A HAVE_PYPY N/A N/A N/A N/A N/A config _builtins_whitelist add compile N/A N/A N/A N/A Sandbox config execute code N/A test_exec_builtins N/A N/A N/A N/A N/A config N/A createSandboxConfig N/A N/A N/A N/A Sandbox config execute N/A N/A 
assert type(__builtins__) != dict
     strip N/A test_builtins_setitem N/A N/A N/A N/A N/A code N/A unindent 
        def builtins_superglobal():
            if isinstance(__builtins__, dict):
                __builtins__['SUPERGLOBAL'] = 42
                assert SUPERGLOBAL == 42
                del __builtins__['SUPERGLOBAL']
            else:
                __builtins__.SUPERGLOBAL = 42
                assert SUPERGLOBAL == 42
                del __builtins__.SUPERGLOBAL
     N/A unsafe_code N/A code N/A unindent 
        try:
            builtins_superglobal()
        except SandboxError, err:
            assert str(err) == "Read only object"
        else:
            assert False
     N/A N/A N/A N/A createSandbox execute unsafe_code N/A safe_code N/A code N/A unindent 
        builtins_superglobal()
     N/A N/A execute_code safe_code N/A test_builtins_init N/A N/A N/A N/A N/A warnings N/A code N/A unindent 
        def check_init():
            __builtins__.__init__({})

        def check_dict_init():
            try:
                dict.__init__(__builtins__, {})
            except ImportError, err:
                assert str(err) == 'Import "_warnings" blocked by the sandbox'
            except DeprecationWarning, err:
                assert str(err) == 'object.__init__() takes no parameters'
            else:
                assert False
     N/A unsafe_code N/A code N/A unindent 
        check_init()
     N/A N/A N/A N/A N/A N/A createSandbox execute unsafe_code N/A N/A N/A SandboxError N/A err N/A N/A N/A N/A str err Read only object N/A str err N/A N/A False N/A test_modify_builtins_dict N/A N/A N/A N/A N/A code N/A unindent 
        def builtins_dict_superglobal():
            __builtins__['SUPERGLOBAL'] = 42
            assert SUPERGLOBAL == 42
            del __builtins__['SUPERGLOBAL']
     N/A unsafe_code N/A code N/A unindent 
        try:
            builtins_dict_superglobal()
        except AttributeError, err:
            assert str(err) == "type object 'dict' has no attribute '__setitem__'"
        else:
            assert False
     N/A N/A N/A N/A N/A N/A createSandbox execute unsafe_code N/A N/A N/A SandboxError N/A err N/A N/A N/A N/A str err Read only object N/A test_del_builtin N/A N/A N/A N/A N/A code N/A unindent 
        def del_builtin_import():
            import_func = __builtins__['__import__']
            dict.__delitem__(__builtins__, '__import__')
            try:
                try:
                    import sys
                except NameError, err:
                    assert str(err) == "type object 'dict' has no attribute '__setitem__'"
            finally:
                __builtins__['__import__'] = import_func
     N/A unsafe_code N/A code N/A unindent 
        try:
            del_builtin_import()
        except AttributeError, err:
            assert str(err) == "type object 'dict' has no attribute '__delitem__'"
        except SandboxError, err:
            assert str(err) == "Read only object"
        else:
            assert False
     N/A config N/A createSandboxConfig N/A N/A N/A config allowModule sys N/A N/A N/A N/A Sandbox config execute unsafe_code N/A