From 9f4ac485660a14bfaa2b755b5d40a5bf8174f42c Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Fri, 18 Jul 2025 16:01:52 +0200 Subject: [PATCH] Issue a deprecation warning for using engine::init_engine --- python/tank/platform/engine.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python/tank/platform/engine.py b/python/tank/platform/engine.py index 636fc33b4..bc22d6ce3 100644 --- a/python/tank/platform/engine.py +++ b/python/tank/platform/engine.py @@ -18,6 +18,7 @@ import pprint import traceback import inspect +import warnings import weakref import threading @@ -294,6 +295,16 @@ def __repr__(self): self.__env.name, ) + def __getattribute__(self, attr): + if attr == "init_engine": + warnings.warn( + f"The method Engine.init_engine is deprecated and will be removed in future versions. " + f"Please use pre_app_init instead.", + DeprecationWarning, + ) + + return super().__getattribute__(attr) + ########################################################################################## # properties used by internal classes, not part of the public interface