Skip to content

Commit 13b0412

Browse files
authored
bpo-46920: Remove code that has explainers why it was disabled (GH-31813)
1 parent a52f82b commit 13b0412

File tree

4 files changed

+0
-64
lines changed

4 files changed

+0
-64
lines changed

Modules/_tkinter.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3440,11 +3440,5 @@ PyInit__tkinter(void)
34403440
return NULL;
34413441
}
34423442

3443-
#if 0
3444-
/* This was not a good idea; through <Destroy> bindings,
3445-
Tcl_Finalize() may invoke Python code but at that point the
3446-
interpreter and thread state have already been destroyed! */
3447-
Py_AtExit(Tcl_Finalize);
3448-
#endif
34493443
return m;
34503444
}

Modules/sre_lib.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -333,34 +333,6 @@ SRE(count)(SRE_STATE* state, const SRE_CODE* pattern, Py_ssize_t maxcount)
333333
return ptr - (SRE_CHAR*) state->ptr;
334334
}
335335

336-
#if 0 /* not used in this release */
337-
LOCAL(int)
338-
SRE(info)(SRE_STATE* state, const SRE_CODE* pattern)
339-
{
340-
/* check if an SRE_OP_INFO block matches at the current position.
341-
returns the number of SRE_CODE objects to skip if successful, 0
342-
if no match */
343-
344-
const SRE_CHAR* end = (const SRE_CHAR*) state->end;
345-
const SRE_CHAR* ptr = (const SRE_CHAR*) state->ptr;
346-
Py_ssize_t i;
347-
348-
/* check minimal length */
349-
if (pattern[3] && end - ptr < pattern[3])
350-
return 0;
351-
352-
/* check known prefix */
353-
if (pattern[2] & SRE_INFO_PREFIX && pattern[5] > 1) {
354-
/* <length> <skip> <prefix data> <overlap data> */
355-
for (i = 0; i < pattern[5]; i++)
356-
if ((SRE_CODE) ptr[i] != pattern[7 + i])
357-
return 0;
358-
return pattern[0] + 2 * pattern[6];
359-
}
360-
return pattern[0];
361-
}
362-
#endif
363-
364336
/* The macros below should be used to protect recursive SRE(match)()
365337
* calls that *failed* and do *not* return immediately (IOW, those
366338
* that will backtrack). Explaining:

Parser/tokenizer.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -282,30 +282,6 @@ check_bom(int get_char(struct tok_state *),
282282
unget_char(ch1, tok);
283283
return 1;
284284
}
285-
#if 0
286-
/* Disable support for UTF-16 BOMs until a decision
287-
is made whether this needs to be supported. */
288-
} else if (ch1 == 0xFE) {
289-
ch2 = get_char(tok);
290-
if (ch2 != 0xFF) {
291-
unget_char(ch2, tok);
292-
unget_char(ch1, tok);
293-
return 1;
294-
}
295-
if (!set_readline(tok, "utf-16-be"))
296-
return 0;
297-
tok->decoding_state = STATE_NORMAL;
298-
} else if (ch1 == 0xFF) {
299-
ch2 = get_char(tok);
300-
if (ch2 != 0xFE) {
301-
unget_char(ch2, tok);
302-
unget_char(ch1, tok);
303-
return 1;
304-
}
305-
if (!set_readline(tok, "utf-16-le"))
306-
return 0;
307-
tok->decoding_state = STATE_NORMAL;
308-
#endif
309285
} else {
310286
unget_char(ch1, tok);
311287
return 1;

Python/ceval.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6997,12 +6997,6 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
69976997
result = 1;
69986998
cf->cf_flags |= compilerflags;
69996999
}
7000-
#if 0 /* future keyword */
7001-
if (codeflags & CO_GENERATOR_ALLOWED) {
7002-
result = 1;
7003-
cf->cf_flags |= CO_GENERATOR_ALLOWED;
7004-
}
7005-
#endif
70067000
}
70077001
return result;
70087002
}

0 commit comments

Comments
 (0)