Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a9fa856

Browse filesBrowse files
authored
gh-151126: Sets missing exceptions in tkinter and socket modules initializations (#152418)
1 parent 0a21a24 commit a9fa856
Copy full SHA for a9fa856

3 files changed

+4-1Lines changed: 4 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+2Lines changed: 2 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix two crashes in :mod:`tkinter` and :mod:`socket` modules initialization
2+
under a memory pressure. Sets missing :exc:`MemoryError`.
Collapse file

‎Modules/_tkinter.c‎

Copy file name to clipboardExpand all lines: Modules/_tkinter.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3574,7 +3574,7 @@ PyInit__tkinter(void)
35743574

35753575
tcl_lock = PyThread_allocate_lock();
35763576
if (tcl_lock == NULL)
3577-
return NULL;
3577+
return PyErr_NoMemory();
35783578

35793579
m = PyModule_Create(&_tkintermodule);
35803580
if (m == NULL)
Collapse file

‎Modules/socketmodule.c‎

Copy file name to clipboardExpand all lines: Modules/socketmodule.c
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9296,6 +9296,7 @@ socket_exec(PyObject *m)
92969296
#if defined(USE_GETHOSTBYNAME_LOCK)
92979297
netdb_lock = PyThread_allocate_lock();
92989298
if (netdb_lock == NULL) {
9299+
PyErr_NoMemory();
92999300
goto error;
93009301
}
93019302
#endif

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.