@@ -19,14 +19,13 @@ load("@rules_testing//lib:analysis_test.bzl", "analysis_test")
1919load ("@rules_testing//lib:truth.bzl" , "matching" )
2020load ("@rules_testing//lib:util.bzl" , rt_util = "util" )
2121load ("//python:py_executable_info.bzl" , "PyExecutableInfo" )
22+ load ("//python/private:reexports.bzl" , "BuiltinPyRuntimeInfo" )
2223load ("//python/private:util.bzl" , "IS_BAZEL_7_OR_HIGHER" ) # buildifier: disable=bzl-visibility
2324load ("//tests/base_rules:base_tests.bzl" , "create_base_tests" )
2425load ("//tests/base_rules:util.bzl" , "WINDOWS_ATTR" , pt_util = "util" )
2526load ("//tests/support:py_executable_info_subject.bzl" , "PyExecutableInfoSubject" )
2627load ("//tests/support:support.bzl" , "CC_TOOLCHAIN" , "CROSSTOOL_TOP" , "LINUX_X86_64" , "WINDOWS_X86_64" )
2728
28- _BuiltinPyRuntimeInfo = PyRuntimeInfo
29-
3029_tests = []
3130
3231def _test_basic_windows (name , config ):
@@ -359,9 +358,10 @@ def _test_py_runtime_info_provided_impl(env, target):
359358 # Make sure that the rules_python loaded symbol is provided.
360359 env .expect .that_target (target ).has_provider (RulesPythonPyRuntimeInfo )
361360
362- # For compatibility during the transition, the builtin PyRuntimeInfo should
363- # also be provided.
364- env .expect .that_target (target ).has_provider (_BuiltinPyRuntimeInfo )
361+ if BuiltinPyRuntimeInfo != None :
362+ # For compatibility during the transition, the builtin PyRuntimeInfo should
363+ # also be provided.
364+ env .expect .that_target (target ).has_provider (BuiltinPyRuntimeInfo )
365365
366366_tests .append (_test_py_runtime_info_provided )
367367
0 commit comments