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 592575c

Browse filesBrowse files
[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 a9fa856) Co-authored-by: sobolevn <mail@sobolevn.me>
1 parent 2c7e890 commit 592575c
Copy full SHA for 592575c

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
@@ -9288,6 +9288,7 @@ socket_exec(PyObject *m)
92889288
#if defined(USE_GETHOSTBYNAME_LOCK)
92899289
netdb_lock = PyThread_allocate_lock();
92909290
if (netdb_lock == NULL) {
9291+
PyErr_NoMemory();
92919292
goto error;
92929293
}
92939294
#endif

0 commit comments

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