1- # Copyright 2020, 2021, 2022, 2023, 2024 Google LLC
1+ # Copyright 2020, 2021, 2022, 2023, 2024, 2025 Google LLC
22#
33# Licensed under the Apache License, Version 2.0 (the "License");
44# you may not use this file except in compliance with the License.
@@ -116,7 +116,7 @@ _emacs_repository = repository_rule(
116116
117117def _local_emacs_impl (ctx ):
118118 windows = ctx .os .name .startswith ("windows" )
119- emacs = _getenv ( ctx , "EMACS" , "emacs" )
119+ emacs = ctx . getenv ( "EMACS" , "emacs" )
120120 if windows and not emacs .lower ().endswith (".exe" ):
121121 emacs += ".exe"
122122 sep = "\\ " if windows else "/"
@@ -141,10 +141,3 @@ _local_emacs = repository_rule(
141141 implementation = _local_emacs_impl ,
142142 local = True ,
143143)
144-
145- def _getenv (ctx , variable , default = None ):
146- if hasattr (ctx , "getenv" ):
147- return ctx .getenv (variable , default )
148- else :
149- # TODO: Remove this branch after dropping support for Bazel 7.0.
150- return ctx .os .environ .get (variable , default )
0 commit comments