diff --git a/sandbox/attributes.py b/sandbox/attributes.py index 28f5894..77394ef 100644 --- a/sandbox/attributes.py +++ b/sandbox/attributes.py @@ -1,3 +1,4 @@ +from __future__ import absolute_import from types import FunctionType, FrameType, GeneratorType from sys import version_info try: diff --git a/sandbox/blacklist_proxy.py b/sandbox/blacklist_proxy.py index 90e9188..62bd183 100644 --- a/sandbox/blacklist_proxy.py +++ b/sandbox/blacklist_proxy.py @@ -5,7 +5,7 @@ inherit from dict: Python/ceval.c uses PyDict_SetItem() and an inlined version of PyDict_GetItem(). """ - +from __future__ import absolute_import from .proxy import readOnlyError def createReadOnlyBuiltins(builtins): diff --git a/sandbox/builtins.py b/sandbox/builtins.py index 6ae236b..99f9b97 100644 --- a/sandbox/builtins.py +++ b/sandbox/builtins.py @@ -1,3 +1,4 @@ +from __future__ import absolute_import import __builtin__ as BUILTINS_MODULE from types import FrameType from sys import _getframe, version_info diff --git a/sandbox/code.py b/sandbox/code.py index c278339..5366c1e 100644 --- a/sandbox/code.py +++ b/sandbox/code.py @@ -1,3 +1,4 @@ +from __future__ import absolute_import from sandbox import Protection from _sandbox import disable_code_new, restore_code_new diff --git a/sandbox/cpython.py b/sandbox/cpython.py index 01cdb5f..82471f9 100644 --- a/sandbox/cpython.py +++ b/sandbox/cpython.py @@ -1,3 +1,4 @@ +from __future__ import absolute_import from sandbox import HAVE_CSANDBOX if HAVE_CSANDBOX: from _sandbox import dictionary_of diff --git a/sandbox/proxy.py b/sandbox/proxy.py index 7d3049f..2c28cd6 100644 --- a/sandbox/proxy.py +++ b/sandbox/proxy.py @@ -1,7 +1,7 @@ """ Proxies using a whitelist policy. """ - +from __future__ import absolute_import from sys import version_info if version_info < (3, 0): from types import NoneType, ClassType, InstanceType diff --git a/sandbox/recursion.py b/sandbox/recursion.py index b0f356f..6faabb6 100644 --- a/sandbox/recursion.py +++ b/sandbox/recursion.py @@ -1,3 +1,4 @@ +from __future__ import absolute_import import sys class SetRecursionLimit: diff --git a/sandbox/restorable_dict.py b/sandbox/restorable_dict.py index 674916d..ba32200 100644 --- a/sandbox/restorable_dict.py +++ b/sandbox/restorable_dict.py @@ -1,3 +1,5 @@ +from __future__ import absolute_import + class RestorableDict: def __init__(self, dict): self.dict = dict diff --git a/sandbox/safe_import.py b/sandbox/safe_import.py index 91d1931..06813f2 100644 --- a/sandbox/safe_import.py +++ b/sandbox/safe_import.py @@ -1,3 +1,4 @@ +from __future__ import absolute_import from .proxy import proxy, readOnlyError def createSafeModule(real_module, attributes, safe_attributes): diff --git a/sandbox/safe_open.py b/sandbox/safe_open.py index 64ebada..4c18212 100644 --- a/sandbox/safe_open.py +++ b/sandbox/safe_open.py @@ -1,3 +1,4 @@ +from __future__ import absolute_import from os.path import realpath from .proxy import createReadOnlyObject from errno import EACCES diff --git a/sandbox/stdio.py b/sandbox/stdio.py index 1436b82..236c711 100644 --- a/sandbox/stdio.py +++ b/sandbox/stdio.py @@ -1,3 +1,4 @@ +from __future__ import absolute_import import sys from sandbox import SandboxError