mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-118761: Defer import of functools in annotationlib (#132059)
This commit is contained in:
parent
a126cefc17
commit
255eb375a7
1 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,6 @@
|
|||
import ast
|
||||
import builtins
|
||||
import enum
|
||||
import functools
|
||||
import keyword
|
||||
import sys
|
||||
import types
|
||||
|
@ -765,9 +764,10 @@ def get_annotations(
|
|||
if hasattr(unwrap, "__wrapped__"):
|
||||
unwrap = unwrap.__wrapped__
|
||||
continue
|
||||
if isinstance(unwrap, functools.partial):
|
||||
unwrap = unwrap.func
|
||||
continue
|
||||
if functools := sys.modules.get("functools"):
|
||||
if isinstance(unwrap, functools.partial):
|
||||
unwrap = unwrap.func
|
||||
continue
|
||||
break
|
||||
if hasattr(unwrap, "__globals__"):
|
||||
obj_globals = unwrap.__globals__
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue