@@ -348,7 +348,6 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase):
348348 '_install_importlib' : 1 ,
349349 'check_hash_pycs_mode' : 'default' ,
350350 '_frozen' : 0 ,
351- '_init_main' : 1 ,
352351 }
353352 if MS_WINDOWS :
354353 DEFAULT_PRE_CONFIG .update ({
@@ -443,7 +442,10 @@ def get_expected_config(self, expected, env):
443442 raise Exception (f"failed to get the default config: "
444443 f"stdout={ proc .stdout !r} stderr={ proc .stderr !r} " )
445444 stdout = proc .stdout .decode ('utf-8' )
446- config = json .loads (stdout )
445+ try :
446+ config = json .loads (stdout )
447+ except json .JSONDecodeError :
448+ self .fail (f"fail to decode stdout: { stdout !r} " )
447449
448450 for key , value in expected .items ():
449451 if value is self .GET_DEFAULT_CONFIG :
@@ -496,7 +498,10 @@ def check_config(self, testname, expected_config, expected_preconfig):
496498
497499 out , err = self .run_embedded_interpreter (testname , env = env )
498500 # Ignore err
499- config = json .loads (out )
501+ try :
502+ config = json .loads (out )
503+ except json .JSONDecodeError :
504+ self .fail (f"fail to decode stdout: { out !r} " )
500505
501506 expected_preconfig = dict (self .DEFAULT_PRE_CONFIG , ** expected_preconfig )
502507 expected_config = self .get_expected_config (expected_config , env )
@@ -533,7 +538,6 @@ def test_init_global_config(self):
533538 'filesystem_encoding' : 'utf-8' ,
534539 'filesystem_errors' : self .UTF8_MODE_ERRORS ,
535540 'user_site_directory' : 0 ,
536- '_frozen' : 1 ,
537541 }
538542 self .check_config ("init_global_config" , config , preconfig )
539543
@@ -578,7 +582,6 @@ def test_init_from_config(self):
578582 'faulthandler' : 1 ,
579583
580584 'check_hash_pycs_mode' : 'always' ,
581- '_frozen' : 1 ,
582585 }
583586 self .check_config ("init_from_config" , config , preconfig )
584587
0 commit comments