@@ -55,6 +55,7 @@ def test_config_get(self):
5555 ("filesystem_errors" , str , None ),
5656 ("hash_seed" , int , None ),
5757 ("home" , str | None , None ),
58+ ("inherit_context" , int , None ),
5859 ("import_time" , bool , None ),
5960 ("inspect" , bool , None ),
6061 ("install_signal_handlers" , bool , None ),
@@ -98,7 +99,7 @@ def test_config_get(self):
9899 ]
99100 if support .Py_DEBUG :
100101 options .append (("run_presite" , str | None , None ))
101- if sysconfig . get_config_var ( ' Py_GIL_DISABLED' ) :
102+ if support . Py_GIL_DISABLED :
102103 options .append (("enable_gil" , int , None ))
103104 options .append (("tlbc_enabled" , int , None ))
104105 if support .MS_WINDOWS :
@@ -170,7 +171,7 @@ def test_config_get_sys_flags(self):
170171 ("warn_default_encoding" , "warn_default_encoding" , False ),
171172 ("safe_path" , "safe_path" , False ),
172173 ("int_max_str_digits" , "int_max_str_digits" , False ),
173- # "gil" is tested below
174+ # "gil" and "inherit_context" are tested below
174175 ):
175176 with self .subTest (flag = flag , name = name , negate = negate ):
176177 value = config_get (name )
@@ -182,11 +183,14 @@ def test_config_get_sys_flags(self):
182183 config_get ('use_hash_seed' ) == 0
183184 or config_get ('hash_seed' ) != 0 )
184185
185- if sysconfig . get_config_var ( ' Py_GIL_DISABLED' ) :
186+ if support . Py_GIL_DISABLED :
186187 value = config_get ('enable_gil' )
187188 expected = (value if value != - 1 else None )
188189 self .assertEqual (sys .flags .gil , expected )
189190
191+ expected_inherit_context = 1 if support .Py_GIL_DISABLED else 0
192+ self .assertEqual (sys .flags .inherit_context , expected_inherit_context )
193+
190194 def test_config_get_non_existent (self ):
191195 # Test PyConfig_Get() on non-existent option name
192196 config_get = _testcapi .config_get
0 commit comments