]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] bpo-14916: interactive fd is not tied to stdin [type-bug] (#91469)
authorPaul m. p. Peny <mail.peny@free.fr>
Sat, 16 Jul 2022 08:35:19 +0000 (10:35 +0200)
committerGitHub <noreply@github.com>
Sat, 16 Jul 2022 08:35:19 +0000 (09:35 +0100)
* bpo-14916: interactive fd is not always stdin

related to https://github.com/python/cpython/pull/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>
Misc/NEWS.d/next/C API/2022-04-13-16-10-55.gh-issue-59121.-B7mKp.rst [new file with mode: 0644]
Parser/pegen_errors.c

diff --git a/Misc/NEWS.d/next/C API/2022-04-13-16-10-55.gh-issue-59121.-B7mKp.rst b/Misc/NEWS.d/next/C API/2022-04-13-16-10-55.gh-issue-59121.-B7mKp.rst
new file mode 100644 (file)
index 0000000..d52866e
--- /dev/null
@@ -0,0 +1 @@
+Fixed an assert that prevented ``PyRun_InteractiveOne`` from providing tracebacks when parsing from the provided FD.
index 5703088443eded68bf436e8acaf374ea04071168..c87d50abd2c71a0b5579ef2fbcde9902b354b315 100644 (file)
@@ -245,7 +245,7 @@ get_error_line_from_tokenizer_buffers(Parser *p, Py_ssize_t lineno)
      * (multi-line) statement are stored in p->tok->interactive_src_start.
      * If not, we're parsing from a string, which means that the whole source
      * is stored in p->tok->str. */
-    assert((p->tok->fp == NULL && p->tok->str != NULL) || p->tok->fp == stdin);
+    assert((p->tok->fp == NULL && p->tok->str != NULL) || p->tok->fp != NULL);
 
     char *cur_line = p->tok->fp_interactive ? p->tok->interactive_src_start : p->tok->str;
     if (cur_line == NULL) {