mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
[3.14] gh-138425: Correctly partially evaluate global generics with undefined params in ref.evaluate(format=Format.FORWARDREF) (GH-138430) (#140927)
gh-138425: Correctly partially evaluate global generics with undefined params in `ref.evaluate(format=Format.FORWARDREF)` (GH-138430)
(cherry picked from commit e66f87ca73)
Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
parent
7e1bac6a1a
commit
23e3771045
3 changed files with 32 additions and 1 deletions
|
|
@ -187,8 +187,11 @@ class ForwardRef:
|
|||
except Exception:
|
||||
if not is_forwardref_format:
|
||||
raise
|
||||
|
||||
# All variables, in scoping order, should be checked before
|
||||
# triggering __missing__ to create a _Stringifier.
|
||||
new_locals = _StringifierDict(
|
||||
{**builtins.__dict__, **locals},
|
||||
{**builtins.__dict__, **globals, **locals},
|
||||
globals=globals,
|
||||
owner=owner,
|
||||
is_class=self.__forward_is_class__,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue