diff --git a/Lib/annotationlib.py b/Lib/annotationlib.py index c08cd4d66589b6..c42dad3503bff7 100644 --- a/Lib/annotationlib.py +++ b/Lib/annotationlib.py @@ -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__ pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy