[3.10] bpo-46240: Correct the error for unclosed parentheses when the tokenizer is not finished (GH-30378). (GH-30819)

(cherry picked from commit 70f415fb8b632247e28d87998642317ca7a652ae)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
4 files changed