diff options
author | Travis Ens <ens.travis@gmail.com> | 2020-12-24 00:40:46 -0500 |
---|---|---|
committer | Travis Ens <ens.travis@gmail.com> | 2020-12-24 00:40:46 -0500 |
commit | b0ab34e8d2e00287894ec50192cfeaa8eab57639 (patch) | |
tree | f0f5e1a609dbd8f54508033a0550074df7d8bead /qutebrowser/config/qtargs.py | |
parent | 7f4897fd925d2a1555f22677bb047c0e00c3ec1f (diff) | |
download | qutebrowser-b0ab34e8d2e00287894ec50192cfeaa8eab57639.tar.gz qutebrowser-b0ab34e8d2e00287894ec50192cfeaa8eab57639.zip |
Fixed comparison with None, properly unset environment variables by deleting
them, updated the test to check this behaviour, refactored test code by
removing redundant variables and improving readability.
Diffstat (limited to 'qutebrowser/config/qtargs.py')
-rw-r--r-- | qutebrowser/config/qtargs.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/qutebrowser/config/qtargs.py b/qutebrowser/config/qtargs.py index dde8e1131..d6375f331 100644 --- a/qutebrowser/config/qtargs.py +++ b/qutebrowser/config/qtargs.py @@ -260,9 +260,8 @@ def init_envvars() -> None: else 'QT_AUTO_SCREEN_SCALE_FACTOR') os.environ[env_var] = '1' - for var in config.val.qt.environ: - val = config.val.qt.environ[var] - if val == 'None': - os.environ[var] = '' - else: + for var, val in config.val.qt.environ.items(): + if val is None and var in os.environ: + del os.environ[var] + elif val is not None: os.environ[var] = val |