diff --git a/src/dependency_injector/schema.py b/src/dependency_injector/schema.py index ac37a6bb..b1971f08 100644 --- a/src/dependency_injector/schema.py +++ b/src/dependency_injector/schema.py @@ -1,5 +1,6 @@ """Schema module.""" +import builtins import importlib from typing import Dict, Any, Type, Optional @@ -204,7 +205,7 @@ def _import_string(string_name: str) -> Optional[object]: segments = string_name.split('.') if len(segments) == 1: - member = __builtins__.get(segments[0]) + member = getattr(builtins, segments[0], None) if member: return member