[3.13] gh-122546: Relax SyntaxError check when raising errors on the new REPL (GH-123233) (#123247)

gh-122546: Relax SyntaxError check when raising errors on the new REPL (GH-123233)
(cherry picked from commit 4c3f0cbeae)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-08-23 02:32:11 +02:00 committed by GitHub
parent 30eee22d3f
commit fda8aec625
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -110,7 +110,7 @@ class InteractiveInterpreter:
colorize = kwargs.pop('colorize', False)
try:
typ, value, tb = sys.exc_info()
if filename and typ is SyntaxError:
if filename and issubclass(typ, SyntaxError):
value.filename = filename
source = kwargs.pop('source', "")
self._showtraceback(typ, value, None, colorize, source)