From bb84f0c7141d7c3a9ba5d6b33fd1949f8e72dccd Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Tue, 17 Jun 2025 19:51:46 -0700 Subject: [PATCH] gh-127146: Allow ignored keys to be missing in test_sysconfig (GH-135622) Fixes the test on Emscripten where userbase can be missing. (cherry picked from commit 28c71ee4b2eb66983b78018896ca56892580816a) Co-authored-by: Hood Chatham --- Lib/test/test_sysconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index d30f69ded6643a..7af3144d69197e 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -712,8 +712,8 @@ def test_sysconfigdata_json(self): ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase', 'installed_base', 'installed_platbase'} for key in ignore_keys: - json_config_vars.pop(key) - system_config_vars.pop(key) + json_config_vars.pop(key, None) + system_config_vars.pop(key, None) self.assertEqual(system_config_vars, json_config_vars)