mirror of
https://github.com/python/cpython.git
synced 2025-09-15 13:16:12 +00:00
[merge from 3.5] Issue28438 - Fix the link for pkgutil.get_data doc.
Patch contributed by Xiang Zhang.
This commit is contained in:
commit
c972d1c76f
1 changed files with 4 additions and 2 deletions
|
@ -206,7 +206,8 @@ support.
|
||||||
|
|
||||||
Get a resource from a package.
|
Get a resource from a package.
|
||||||
|
|
||||||
This is a wrapper for the :term:`loader` :func:`get_data` API. The
|
This is a wrapper for the :term:`loader`
|
||||||
|
:meth:`get_data <importlib.abc.ResourceLoader.get_data>` API. The
|
||||||
*package* argument should be the name of a package, in standard module format
|
*package* argument should be the name of a package, in standard module format
|
||||||
(``foo.bar``). The *resource* argument should be in the form of a relative
|
(``foo.bar``). The *resource* argument should be in the form of a relative
|
||||||
filename, using ``/`` as the path separator. The parent directory name
|
filename, using ``/`` as the path separator. The parent directory name
|
||||||
|
@ -222,4 +223,5 @@ support.
|
||||||
data = open(os.path.join(d, resource), 'rb').read()
|
data = open(os.path.join(d, resource), 'rb').read()
|
||||||
|
|
||||||
If the package cannot be located or loaded, or it uses a :term:`loader`
|
If the package cannot be located or loaded, or it uses a :term:`loader`
|
||||||
which does not support :func:`get_data`, then ``None`` is returned.
|
which does not support :meth:`get_data <importlib.abc.ResourceLoader.get_data>`,
|
||||||
|
then ``None`` is returned.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue