mirror of
https://github.com/python/cpython.git
synced 2026-06-27 19:36:07 +00:00
[3.15] gh-151126: Sets missing exceptions in tkinter and socket modules initializations (GH-152418) (#152420)
gh-151126: Sets missing exceptions in `tkinter` and `socket` modules initializations (GH-152418)
(cherry picked from commit a9fa856014)
Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
parent
2c7e8908cd
commit
592575ca7a
3 changed files with 4 additions and 1 deletions
|
|
@ -0,0 +1,2 @@
|
|||
Fix two crashes in :mod:`tkinter` and :mod:`socket` modules initialization
|
||||
under a memory pressure. Sets missing :exc:`MemoryError`.
|
||||
|
|
@ -3574,7 +3574,7 @@ PyInit__tkinter(void)
|
|||
|
||||
tcl_lock = PyThread_allocate_lock();
|
||||
if (tcl_lock == NULL)
|
||||
return NULL;
|
||||
return PyErr_NoMemory();
|
||||
|
||||
m = PyModule_Create(&_tkintermodule);
|
||||
if (m == NULL)
|
||||
|
|
|
|||
|
|
@ -9288,6 +9288,7 @@ socket_exec(PyObject *m)
|
|||
#if defined(USE_GETHOSTBYNAME_LOCK)
|
||||
netdb_lock = PyThread_allocate_lock();
|
||||
if (netdb_lock == NULL) {
|
||||
PyErr_NoMemory();
|
||||
goto error;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue