diff --git a/Doc/distutils/index.rst b/Doc/distutils/index.rst index b3a52317699..c8dd9f46a8c 100644 --- a/Doc/distutils/index.rst +++ b/Doc/distutils/index.rst @@ -20,7 +20,6 @@ very little overhead for build/release/install mechanics. .. toctree:: :maxdepth: 2 - :numbered: introduction.rst setupscript.rst diff --git a/Doc/library/packaging.rst b/Doc/library/packaging.rst index 5bf2c06ad9d..c6bff47015e 100644 --- a/Doc/library/packaging.rst +++ b/Doc/library/packaging.rst @@ -23,7 +23,6 @@ Building blocks .. toctree:: :maxdepth: 2 - :numbered: packaging-misc packaging.version @@ -42,7 +41,6 @@ The command machinery .. toctree:: :maxdepth: 2 - :numbered: packaging.dist packaging.command @@ -55,7 +53,6 @@ Other utilities .. toctree:: :maxdepth: 2 - :numbered: packaging.util packaging.tests.pypi_server diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py index fda6f5b807e..222bd5478fc 100644 --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -623,16 +623,20 @@ class FutureTests(unittest.TestCase): self.assertTrue(isinstance(f1.exception(timeout=5), IOError)) +@test.support.reap_threads def test_main(): - test.support.run_unittest(ProcessPoolExecutorTest, - ThreadPoolExecutorTest, - ProcessPoolWaitTests, - ThreadPoolWaitTests, - ProcessPoolAsCompletedTests, - ThreadPoolAsCompletedTests, - FutureTests, - ProcessPoolShutdownTest, - ThreadPoolShutdownTest) + try: + test.support.run_unittest(ProcessPoolExecutorTest, + ThreadPoolExecutorTest, + ProcessPoolWaitTests, + ThreadPoolWaitTests, + ProcessPoolAsCompletedTests, + ThreadPoolAsCompletedTests, + FutureTests, + ProcessPoolShutdownTest, + ThreadPoolShutdownTest) + finally: + test.support.reap_children() if __name__ == "__main__": test_main() diff --git a/Misc/NEWS b/Misc/NEWS index 93ae3ee9be6..1565d72a12e 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -228,6 +228,9 @@ Core and Builtins Library ------- +- Issue #11321: Fix a crash with multiple imports of the _pickle module when + embedding Python. Patch by Andreas Stührk. + - Issue #6755: Add get_wch() method to curses.window class. Patch by Iñigo Serna. diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 822d03c49af..06bce1e6e33 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -6338,8 +6338,10 @@ PyInit__pickle(void) if (m == NULL) return NULL; + Py_INCREF(&Pickler_Type); if (PyModule_AddObject(m, "Pickler", (PyObject *)&Pickler_Type) < 0) return NULL; + Py_INCREF(&Unpickler_Type); if (PyModule_AddObject(m, "Unpickler", (PyObject *)&Unpickler_Type) < 0) return NULL;