Skip to content

Commit bbb2ab7

Browse files
pmp-pblurb-it[bot]
andauthored
[3.11] bpo-14916: interactive fd is not tied to stdin [type-bug] (#91469)
* bpo-14916: interactive fd is not always stdin related to #31006 merged bugfix following https://bugs.python.org/issue14916 * 📜🤖 Added by blurb_it. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
1 parent 7502af8 commit bbb2ab7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed an assert that prevented ``PyRun_InteractiveOne`` from providing tracebacks when parsing from the provided FD.

Parser/pegen_errors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ get_error_line_from_tokenizer_buffers(Parser *p, Py_ssize_t lineno)
245245
* (multi-line) statement are stored in p->tok->interactive_src_start.
246246
* If not, we're parsing from a string, which means that the whole source
247247
* is stored in p->tok->str. */
248-
assert((p->tok->fp == NULL && p->tok->str != NULL) || p->tok->fp == stdin);
248+
assert((p->tok->fp == NULL && p->tok->str != NULL) || p->tok->fp != NULL);
249249

250250
char *cur_line = p->tok->fp_interactive ? p->tok->interactive_src_start : p->tok->str;
251251
if (cur_line == NULL) {

0 commit comments

Comments
 (0)