diff --git a/setup/tank_api_proxy/sgtk/__init__.py b/setup/tank_api_proxy/sgtk/__init__.py index 0d32df077f..d1e008da8d 100644 --- a/setup/tank_api_proxy/sgtk/__init__.py +++ b/setup/tank_api_proxy/sgtk/__init__.py @@ -62,6 +62,15 @@ pipeline_config = os.path.abspath(pipeline_config) os.environ["TANK_CURRENT_PC"] = pipeline_config +# From: https://stackoverflow.com/a/40119302 +try: + reload # Python 2.7 +except NameError: + try: + from importlib import reload # Python 3.4+ + except ImportError: + from imp import reload # Python 3.0 - 3.3 + # ok we got the parent location # prepend this to the python path and reload the module # this way we will load the 'real' tank! diff --git a/setup/tank_api_proxy/tank/__init__.py b/setup/tank_api_proxy/tank/__init__.py index 11dc2b6b06..5023e3e77b 100644 --- a/setup/tank_api_proxy/tank/__init__.py +++ b/setup/tank_api_proxy/tank/__init__.py @@ -60,6 +60,15 @@ pipeline_config = os.path.abspath(pipeline_config) os.environ["TANK_CURRENT_PC"] = pipeline_config +# From: https://stackoverflow.com/a/40119302 +try: + reload # Python 2.7 +except NameError: + try: + from importlib import reload # Python 3.4+ + except ImportError: + from imp import reload # Python 3.0 - 3.3 + # ok we got the parent location # prepend this to the python path and reload the module # this way we will load the 'real' tank!