diff options
| author | Benjamin Cabé <benjamin@zephyrproject.org> | 2025-10-23 17:25:08 +0200 |
|---|---|---|
| committer | Torsten Tejlmand Rasmussen <torsten.rasmussen@nordicsemi.no> | 2026-02-02 08:22:15 +0100 |
| commit | 24aef157aead07f813f874f43ee471b057e622cb (patch) | |
| tree | 57cbb867898e31f9efb3fcce0997ecd3267ea1cc /genconfig.py | |
| parent | ffb54593b899c42fe70e55d26e02d4cd4a9ca53d (diff) | |
drop support for Python 2.x as it is very much EOL
A follow-up to b96a5ad562deffa697d966c29546650aae645f48 where we stopped
having CI run tests on Python 2.x. This actually drops the few remaining
Python 2.x compatibility bits as Python 2.x has EOL'd a long time ago.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Diffstat (limited to 'genconfig.py')
| -rwxr-xr-x | genconfig.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/genconfig.py b/genconfig.py index 62f065b..aa0b472 100755 --- a/genconfig.py +++ b/genconfig.py @@ -131,24 +131,15 @@ only supported for backwards compatibility). kconf.sync_deps(args.sync_deps) if args.file_list is not None: - with _open_write(args.file_list) as f: + with open(args.file_list, "w", encoding="utf-8") as f: for path in kconf.kconfig_filenames: f.write(path + "\n") if args.env_list is not None: - with _open_write(args.env_list) as f: + with open(args.env_list, "w", encoding="utf-8") as f: for env_var in kconf.env_vars: f.write("{}={}\n".format(env_var, os.environ[env_var])) -def _open_write(path): - # Python 2/3 compatibility. io.open() is available on both, but makes - # write() expect 'unicode' strings on Python 2. - - if sys.version_info[0] < 3: - return open(path, "w") - return open(path, "w", encoding="utf-8") - - if __name__ == "__main__": main() |
