[8.2.x] Add Python 3.13 (beta) support

This commit is contained in:
Ran Benita
2024-05-19 09:45:09 +03:00
committed by pytest bot
parent f3dd93ad8d
commit 0b28313b46
11 changed files with 45 additions and 34 deletions

View File

@@ -424,15 +424,14 @@ class Traceback(List[TracebackEntry]):
# which generates code objects that have hash/value equality
# XXX needs a test
key = entry.frame.code.path, id(entry.frame.code.raw), entry.lineno
# print "checking for recursion at", key
values = cache.setdefault(key, [])
# Since Python 3.13 f_locals is a proxy, freeze it.
loc = dict(entry.frame.f_locals)
if values:
f = entry.frame
loc = f.f_locals
for otherloc in values:
if otherloc == loc:
return i
values.append(entry.frame.f_locals)
values.append(loc)
return None