From 26e8fe8bb3dc71e68be6e146713a7d45748ab963 Mon Sep 17 00:00:00 2001 From: Brittany Reynoso Date: Mon, 15 Dec 2025 13:51:27 -0500 Subject: [PATCH] Fix implicit import in function.py This code is not fully compatible with Lazy Imports. It requires `decord._api_internal` to have been loaded ahead of the `sys.modules` access--which is not guaranteed when modules are loaded lazily --- python/decord/_ffi/function.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/decord/_ffi/function.py b/python/decord/_ffi/function.py index 1302d9ce..ecd7820d 100644 --- a/python/decord/_ffi/function.py +++ b/python/decord/_ffi/function.py @@ -301,6 +301,8 @@ def _init_api_prefix(module_name, prefix): setattr(target_module, ff.__name__, ff) def _init_internal_api(): + # Ensure this module has been loaded ahead of accessing it below + import decord._api_internal for name in list_global_func_names(): if not name.startswith("_"): continue