From 5f32d2e56f7f3583c90aaec9e5b96dfcadd56da5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 16 Sep 2021 10:16:33 +0530 Subject: [PATCH] Uppercase DELETE_ENV_VAR --- kitty/child.py | 4 ++-- kitty/options/utils.py | 4 ++-- kitty_tests/options.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kitty/child.py b/kitty/child.py index fb9d2a909..5dbbcc021 100644 --- a/kitty/child.py +++ b/kitty/child.py @@ -209,7 +209,7 @@ class Child: @property def final_env(self) -> Dict[str, str]: - from kitty.options.utils import delete_env_var + from kitty.options.utils import DELETE_ENV_VAR env: Optional[Dict[str, str]] = getattr(self, '_final_env', None) if env is None: env = self._final_env = default_env().copy() @@ -233,7 +233,7 @@ class Child: from .shell_integration import get_supported_shell_name if get_supported_shell_name(self.argv[0]): env['KITTY_SHELL_INTEGRATION'] = opts.shell_integration - env = {k: v for k, v in env.items() if v is not delete_env_var} + env = {k: v for k, v in env.items() if v is not DELETE_ENV_VAR} return env def fork(self) -> Optional[int]: diff --git a/kitty/options/utils.py b/kitty/options/utils.py index 6013fd6c7..76911c75f 100644 --- a/kitty/options/utils.py +++ b/kitty/options/utils.py @@ -42,7 +42,7 @@ for x in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ': sequence_sep = '>' func_with_args, args_funcs = key_func() FuncArgsType = Tuple[str, Sequence[Any]] -delete_env_var = '_delete_this_env_var_' +DELETE_ENV_VAR = '_delete_this_env_var_' class InvalidMods(ValueError): @@ -742,7 +742,7 @@ def env(val: str, current_val: Dict[str, str]) -> Iterable[Tuple[str, str]]: v = expandvars(v, current_val) yield key, v else: - yield val, delete_env_var + yield val, DELETE_ENV_VAR def kitten_alias(val: str) -> Iterable[Tuple[str, List[str]]]: diff --git a/kitty_tests/options.py b/kitty_tests/options.py index 8b6b736f0..d7d35f78f 100644 --- a/kitty_tests/options.py +++ b/kitty_tests/options.py @@ -5,7 +5,7 @@ from . import BaseTest from kitty.utils import log_error -from kitty.options.utils import delete_env_var +from kitty.options.utils import DELETE_ENV_VAR class TestConfParsing(BaseTest): @@ -50,7 +50,7 @@ class TestConfParsing(BaseTest): opts = p('pointer_shape_when_grabbed XXX', bad_line_num=1) self.ae(opts.pointer_shape_when_grabbed, defaults.pointer_shape_when_grabbed) opts = p('env A=1', 'env B=x$A', 'env C=', 'env D', 'clear_all_shortcuts y', 'kitten_alias a b --moo', 'map f1 kitten a') - self.ae(opts.env, {'A': '1', 'B': 'x1', 'C': '', 'D': delete_env_var}) + self.ae(opts.env, {'A': '1', 'B': 'x1', 'C': '', 'D': DELETE_ENV_VAR}) ka = tuple(opts.keymap.values())[0] self.ae(ka.args, ('b', '--moo')) opts = p('kitty_mod alt')