mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Close #15387: inspect.getmodulename() now uses a new importlib.machinery.all_suffixes() API rather than the deprecated inspect.getmoduleinfo()
This commit is contained in:
parent
90db661b43
commit
76e077001d
5 changed files with 40 additions and 6 deletions
|
|
@ -533,12 +533,23 @@ find and load modules.
|
|||
|
||||
.. attribute:: EXTENSION_SUFFIXES
|
||||
|
||||
A list of strings representing the the recognized file suffixes for
|
||||
A list of strings representing the recognized file suffixes for
|
||||
extension modules.
|
||||
|
||||
.. versionadded:: 3.3
|
||||
|
||||
|
||||
.. func:: all_suffixes()
|
||||
|
||||
Returns a combined list of strings representing all file suffixes for
|
||||
Python modules recognized by the standard import machinery. This is a
|
||||
helper for code which simply needs to know if a filesystem path
|
||||
potentially represents a Python module (for example,
|
||||
:func:`inspect.getmodulename`)
|
||||
|
||||
.. versionadded:: 3.3
|
||||
|
||||
|
||||
.. class:: BuiltinImporter
|
||||
|
||||
An :term:`importer` for built-in modules. All known built-in modules are
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue