diff --git a/python/private/bzlmod/python.bzl b/python/private/bzlmod/python.bzl index 3b59d5be92..d337c8c7d1 100644 --- a/python/private/bzlmod/python.bzl +++ b/python/private/bzlmod/python.bzl @@ -46,11 +46,12 @@ def _print_warn(msg): def _python_register_toolchains(name, toolchain_attr, module): """Calls python_register_toolchains and returns a struct used to collect the toolchains. """ + ignore_root_user_error = not (module.is_root and toolchain_attr.ignore_root_user_error) python_register_toolchains( name = name, python_version = toolchain_attr.python_version, register_coverage_tool = toolchain_attr.configure_coverage_tool, - ignore_root_user_error = toolchain_attr.ignore_root_user_error, + ignore_root_user_error = ignore_root_user_error, ) return struct( python_version = toolchain_attr.python_version,