diff --git a/src/dependency_injector/providers.pyx b/src/dependency_injector/providers.pyx index 8208ad63..64a6bf3b 100644 --- a/src/dependency_injector/providers.pyx +++ b/src/dependency_injector/providers.pyx @@ -5034,7 +5034,7 @@ def _resolve_calling_module(): def _resolve_calling_package_name(): module = _resolve_calling_module() - return module.__package__ + return getattr(module, "__package__", None) cpdef _copy_parent(object from_, object to, dict memo):