Skip to content

Commit c319b2b

Browse files
committed
comment: use a constant
1 parent 472cc40 commit c319b2b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

python/private/hermetic_runtime_repo_setup.bzl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ load(":glob_excludes.bzl", "glob_excludes")
2121
load(":py_exec_tools_toolchain.bzl", "py_exec_tools_toolchain")
2222
load(":semver.bzl", "semver")
2323

24+
_IS_FREETHREADED = Label("//python/config_settings:is_py_freethreaded")
25+
2426
def define_hermetic_runtime_toolchain_impl(
2527
*,
2628
name,
@@ -50,7 +52,6 @@ def define_hermetic_runtime_toolchain_impl(
5052
use.
5153
"""
5254
_ = name # @unused
53-
is_freethreaded = Label("//python/config_settings:is_py_freethreaded")
5455
version_info = semver(python_version)
5556
version_dict = version_info.to_dict()
5657
native.filegroup(
@@ -84,7 +85,7 @@ def define_hermetic_runtime_toolchain_impl(
8485
cc_import(
8586
name = "interface",
8687
interface_library = select({
87-
is_freethreaded: "libs/python{major}{minor}t.lib".format(**version_dict),
88+
_IS_FREETHREADED: "libs/python{major}{minor}t.lib".format(**version_dict),
8889
"//conditions:default": "libs/python{major}{minor}.lib".format(**version_dict),
8990
}),
9091
system_provided = True,
@@ -104,7 +105,7 @@ def define_hermetic_runtime_toolchain_impl(
104105
includes = [
105106
"include",
106107
] + select({
107-
is_freethreaded: [
108+
_IS_FREETHREADED: [
108109
"include/python{major}.{minor}t".format(**version_dict),
109110
# FIXME @aignas 2024-11-05: the following looks fishy - should
110111
# we have a config setting for `m` (i.e. DEBUG builds)?
@@ -196,7 +197,7 @@ def define_hermetic_runtime_toolchain_impl(
196197
implementation_name = "cpython",
197198
# See https://peps.python.org/pep-3147/ for pyc tag infix format
198199
pyc_tag = select({
199-
is_freethreaded: "cpython-{major}{minor}t".format(**version_dict),
200+
_IS_FREETHREADED: "cpython-{major}{minor}t".format(**version_dict),
200201
"//conditions:default": "cpython-{major}{minor}".format(**version_dict),
201202
}),
202203
)

0 commit comments

Comments
 (0)