mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-34008: Allow to call Py_Main() after Py_Initialize() (GH-8043)
Py_Main() can again be called after Py_Initialize(), as in Python 3.6. The new configuration is ignored, except of _PyMainInterpreterConfig.argv which is used to update sys.argv.
This commit is contained in:
parent
2c5c0a367c
commit
fb47bca9ee
5 changed files with 52 additions and 6 deletions
|
@ -238,6 +238,14 @@ class EmbeddingTests(unittest.TestCase):
|
|||
self.assertEqual(out, '')
|
||||
self.assertEqual(err, '')
|
||||
|
||||
def test_initialize_pymain(self):
|
||||
"""
|
||||
bpo-34008: Calling Py_Main() after Py_Initialize() must not fail.
|
||||
"""
|
||||
out, err = self.run_embedded_interpreter("initialize_pymain")
|
||||
self.assertEqual(out.rstrip(), "Py_Main() after Py_Initialize: sys.argv=['-c', 'arg2']")
|
||||
self.assertEqual(err, '')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue