Skip to content

Commit bfcbc3d

Browse files
authored
Change sysconfig import to lazy as well
1 parent 94273d7 commit bfcbc3d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/ctypes/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import sys as _sys
55
import types as _types
66

7+
lazy import sysconfig as _sysconfig
8+
79
from _ctypes import Union, Structure, Array
810
from _ctypes import _Pointer
911
from _ctypes import CFuncPtr as _CFuncPtr
@@ -549,9 +551,7 @@ def LoadLibrary(self, name):
549551
pythonapi = PyDLL("python dll", None, _sys.dllhandle)
550552
elif _sys.platform in ["android", "cygwin"]:
551553
# These are Unix-like platforms which use a dynamically-linked libpython.
552-
import sysconfig # delay import
553-
pythonapi = PyDLL(sysconfig.get_config_var("LDLIBRARY"))
554-
del sysconfig
554+
pythonapi = PyDLL(_sysconfig.get_config_var("LDLIBRARY"))
555555
else:
556556
pythonapi = PyDLL(None)
557557

0 commit comments

Comments
 (0)