Skip to content

lazy import of _sysconfig in Lib/ctypes/__init__.py is eager on android and cygwin #158684

Description

@asottile

Bug report

(this was found using some recent static analysis capabilities I added to pyflakes -- it searches for lazy imports which are used at the module scope within the module)

$ git grep -El '^lazy (from|import)' -- '*.py' | xargs pyflakes 2> /dev/null | grep ' eager use'
Lib/ctypes/__init__.py:560:23: eager use of lazily imported '_sysconfig' from line 7
Lib/ctypes/__init__.py:562:23: eager use of lazily imported '_sysconfig' from line 7
Lib/test/test_lazy_import/data/basic_used.py:3:1: eager use of lazily imported 'basic2' from line 1
Lib/test/test_lazy_import/data/lazy_import_pkg.py:2:5: eager use of lazily imported 'test' from line 1

(the latter two are test data which makes sense to ignore)

the ctypes one however appears to be valid:

this appears to be the result of #146547

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions