mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #18076: Introduce imoportlib.util.decode_source().
The helper function makes it easier to implement imoprtlib.abc.InspectLoader.get_source() by making that function require just the raw bytes for source code and handling all other details.
This commit is contained in:
parent
f4375ef4d4
commit
f24fecd4ac
6 changed files with 3629 additions and 3572 deletions
|
@ -916,6 +916,14 @@ an :term:`importer`.
|
|||
|
||||
.. versionadded:: 3.4
|
||||
|
||||
.. function:: decode_source(source_bytes)
|
||||
|
||||
Decode the given bytes representing source code and return it as a string
|
||||
with universal newlines (as required by
|
||||
:meth:`importlib.abc.InspectLoader.get_source`).
|
||||
|
||||
.. versionadded:: 3.4
|
||||
|
||||
.. function:: resolve_name(name, package)
|
||||
|
||||
Resolve a relative module name to an absolute one.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue