gh-146547: Use lazy imports in ctypes (GH-146548)

This commit is contained in:
Jonathan Dung 2026-04-07 21:26:53 +08:00 committed by GitHub
parent dfeb160bc3
commit e65987d4c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 4 deletions

View file

@ -2,9 +2,10 @@
import os as _os
import sys as _sys
import sysconfig as _sysconfig
import types as _types
lazy import sysconfig as _sysconfig
from _ctypes import Union, Structure, Array
from _ctypes import _Pointer
from _ctypes import CFuncPtr as _CFuncPtr

View file

@ -5,11 +5,12 @@
"""
import sys
import warnings
from _ctypes import CField, buffer_info
import ctypes
lazy import warnings
def round_down(n, multiple):
assert n >= 0
assert multiple > 0

View file

@ -1,8 +1,9 @@
import os
import shutil
import subprocess
import sys
lazy import shutil
lazy import subprocess
# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":