]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46920: Remove code that has explainers why it was disabled (GH-31813)
authorOleg Iarygin <oleg@arhadthedev.net>
Mon, 14 Mar 2022 16:04:22 +0000 (19:04 +0300)
committerGitHub <noreply@github.com>
Mon, 14 Mar 2022 16:04:22 +0000 (17:04 +0100)
Modules/_tkinter.c
Modules/sre_lib.h
Parser/tokenizer.c
Python/ceval.c

index cbef9ce0066db5256bdb384a4b3f854d469c2f78..cd167fd81250ea3ada9b40a54a54caa7aa36825e 100644 (file)
@@ -3440,11 +3440,5 @@ PyInit__tkinter(void)
         return NULL;
     }
 
-#if 0
-    /* This was not a good idea; through <Destroy> bindings,
-       Tcl_Finalize() may invoke Python code but at that point the
-       interpreter and thread state have already been destroyed! */
-    Py_AtExit(Tcl_Finalize);
-#endif
     return m;
 }
index 322f66fb4da6c7262464e602e8b984aeb4608d56..32469cd161cf3b5fa36a5fb68f96d35f5938c18c 100644 (file)
@@ -333,34 +333,6 @@ SRE(count)(SRE_STATE* state, const SRE_CODE* pattern, Py_ssize_t maxcount)
     return ptr - (SRE_CHAR*) state->ptr;
 }
 
-#if 0 /* not used in this release */
-LOCAL(int)
-SRE(info)(SRE_STATE* state, const SRE_CODE* pattern)
-{
-    /* check if an SRE_OP_INFO block matches at the current position.
-       returns the number of SRE_CODE objects to skip if successful, 0
-       if no match */
-
-    const SRE_CHAR* end = (const SRE_CHAR*) state->end;
-    const SRE_CHAR* ptr = (const SRE_CHAR*) state->ptr;
-    Py_ssize_t i;
-
-    /* check minimal length */
-    if (pattern[3] && end - ptr < pattern[3])
-        return 0;
-
-    /* check known prefix */
-    if (pattern[2] & SRE_INFO_PREFIX && pattern[5] > 1) {
-        /* <length> <skip> <prefix data> <overlap data> */
-        for (i = 0; i < pattern[5]; i++)
-            if ((SRE_CODE) ptr[i] != pattern[7 + i])
-                return 0;
-        return pattern[0] + 2 * pattern[6];
-    }
-    return pattern[0];
-}
-#endif
-
 /* The macros below should be used to protect recursive SRE(match)()
  * calls that *failed* and do *not* return immediately (IOW, those
  * that will backtrack). Explaining:
index 6698d35ea94276fa6eebbb1bd812b91482a8f070..90dc8a2e369714472d89a29a825296bbaa4c9e91 100644 (file)
@@ -282,30 +282,6 @@ check_bom(int get_char(struct tok_state *),
             unget_char(ch1, tok);
             return 1;
         }
-#if 0
-    /* Disable support for UTF-16 BOMs until a decision
-       is made whether this needs to be supported.  */
-    } else if (ch1 == 0xFE) {
-        ch2 = get_char(tok);
-        if (ch2 != 0xFF) {
-            unget_char(ch2, tok);
-            unget_char(ch1, tok);
-            return 1;
-        }
-        if (!set_readline(tok, "utf-16-be"))
-            return 0;
-        tok->decoding_state = STATE_NORMAL;
-    } else if (ch1 == 0xFF) {
-        ch2 = get_char(tok);
-        if (ch2 != 0xFE) {
-            unget_char(ch2, tok);
-            unget_char(ch1, tok);
-            return 1;
-        }
-        if (!set_readline(tok, "utf-16-le"))
-            return 0;
-        tok->decoding_state = STATE_NORMAL;
-#endif
     } else {
         unget_char(ch1, tok);
         return 1;
index f75147966421960172b4288806831cc6dd4a2a35..adbf1f689d908a9870658a6e93a690dfb508929c 100644 (file)
@@ -6997,12 +6997,6 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
             result = 1;
             cf->cf_flags |= compilerflags;
         }
-#if 0 /* future keyword */
-        if (codeflags & CO_GENERATOR_ALLOWED) {
-            result = 1;
-            cf->cf_flags |= CO_GENERATOR_ALLOWED;
-        }
-#endif
     }
     return result;
 }