Call PyErr_NoMemory() when PyMem_Malloc() fails.
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 4aa8594..8288c96 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -468,8 +468,10 @@
             const char *e = s + size;
             PyErr_Clear();
             q = buf = (char *)PyMem_Malloc(size);
-            if (buf == NULL)
+            if (buf == NULL) {
+                PyErr_NoMemory();
                 return NULL;
+            }
             while (s != e) {
                 if (s + 1 != e && s[0] == '\xc0' && s[1] == '\x80') {
                     *q++ = '\0';