diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-05-02 19:30:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-02 19:30:21 (GMT) |
commit | 4631da1242fc96002a3c0462a87d087e567368aa (patch) | |
tree | 217203b1293ecc7ac92679c9da38338f1a0c3f1f /Lib/test/test_embed.py | |
parent | 70005ac0fddd8585725b92acd1bc2b8e7b81999c (diff) | |
download | cpython-4631da1242fc96002a3c0462a87d087e567368aa.zip cpython-4631da1242fc96002a3c0462a87d087e567368aa.tar.gz cpython-4631da1242fc96002a3c0462a87d087e567368aa.tar.bz2 |
bpo-36763: Remove _PyCoreConfig._init_main (GH-13066)
Diffstat (limited to 'Lib/test/test_embed.py')
-rw-r--r-- | Lib/test/test_embed.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index fb00519..fdf5793 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -348,7 +348,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): '_install_importlib': 1, 'check_hash_pycs_mode': 'default', '_frozen': 0, - '_init_main': 1, } if MS_WINDOWS: DEFAULT_PRE_CONFIG.update({ @@ -443,7 +442,10 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): raise Exception(f"failed to get the default config: " f"stdout={proc.stdout!r} stderr={proc.stderr!r}") stdout = proc.stdout.decode('utf-8') - config = json.loads(stdout) + try: + config = json.loads(stdout) + except json.JSONDecodeError: + self.fail(f"fail to decode stdout: {stdout!r}") for key, value in expected.items(): if value is self.GET_DEFAULT_CONFIG: @@ -496,7 +498,10 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): out, err = self.run_embedded_interpreter(testname, env=env) # Ignore err - config = json.loads(out) + try: + config = json.loads(out) + except json.JSONDecodeError: + self.fail(f"fail to decode stdout: {out!r}") expected_preconfig = dict(self.DEFAULT_PRE_CONFIG, **expected_preconfig) expected_config = self.get_expected_config(expected_config, env) @@ -533,7 +538,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'filesystem_encoding': 'utf-8', 'filesystem_errors': self.UTF8_MODE_ERRORS, 'user_site_directory': 0, - '_frozen': 1, } self.check_config("init_global_config", config, preconfig) @@ -578,7 +582,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 'faulthandler': 1, 'check_hash_pycs_mode': 'always', - '_frozen': 1, } self.check_config("init_from_config", config, preconfig) |