]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-104050: Don't star-import 'types' in Argument Clinic (#104543)
authorErlend E. Aasland <erlend.aasland@protonmail.com>
Tue, 16 May 2023 12:02:18 +0000 (14:02 +0200)
committerGitHub <noreply@github.com>
Tue, 16 May 2023 12:02:18 +0000 (12:02 +0000)
Tools/clinic/clinic.py

index 6020935f8304c5ea107ae06dde2941e539a550ce..0ef5deb586d6ee31293c0d6f53ec49640ac012a6 100755 (executable)
@@ -25,10 +25,9 @@ import string
 import sys
 import textwrap
 import traceback
-import types
 
 from collections.abc import Callable
-from types import *
+from types import FunctionType, NoneType
 from typing import Any, NamedTuple
 
 # TODO:
@@ -4037,7 +4036,7 @@ def eval_ast_expr(node, globals, *, filename='-'):
 
     node = ast.Expression(node)
     co = compile(node, filename, 'eval')
-    fn = types.FunctionType(co, globals)
+    fn = FunctionType(co, globals)
     return fn()