Skip to content

Commit 622d3a1

Browse files
committed
simplify docs
1 parent f0fb424 commit 622d3a1

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

Doc/library/importlib.rst

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -417,12 +417,12 @@ ABC hierarchy::
417417
that allows storing arbitrary data
418418
can implement this abstract method to give direct access
419419
to the data stored.
420+
The *path* is expected to be constructed using a module's
421+
:attr:`__file__` attribute or an item from a package's
422+
:attr:`__path__` attribute.
420423

421-
An :exc:`OSError` is to be raised if the *path* cannot be found, and
422-
a :exc:`ValueError` is raised if the *path* cannot be handled (e.g.,
423-
the *path* contains null characters or the *path* is too long). The
424-
*path* is expected to be constructed using a module's :attr:`__file__`
425-
attribute or an item from a package's :attr:`__path__`.
424+
If the *path* cannot be handled, this raises an :exc:`OSError`
425+
or a :exc:`ValueError` depending on the reason.
426426

427427
.. versionchanged:: 3.4
428428
Raise :exc:`OSError` by default instead of :exc:`NotImplementedError`.
@@ -555,9 +555,8 @@ ABC hierarchy::
555555

556556
Reads *path* as a binary file and returns the bytes from it.
557557

558-
An :exc:`OSError` is to be raised if the *path* cannot be found, and
559-
a :exc:`ValueError` is raised if the *path* is invalid (e.g., *path*
560-
contains null characters or is too long).
558+
If the *path* cannot be handled, this raises an :exc:`OSError`
559+
or a :exc:`ValueError` depending on the reason.
561560

562561
.. class:: SourceLoader
563562

@@ -589,8 +588,8 @@ ABC hierarchy::
589588
- ``'size'`` (optional): the size in bytes of the source code.
590589

591590
Any other keys in the dictionary are ignored, to allow for future
592-
extensions. If the path cannot be handled, raises an :exc:`OSError`
593-
or a :exc:`ValueError` depending on the reason.
591+
extensions. If the *path* cannot be handled, this raises an
592+
:exc:`OSError` or a :exc:`ValueError` depending on the reason.
594593

595594
.. versionadded:: 3.3
596595

@@ -605,8 +604,8 @@ ABC hierarchy::
605604
.. deprecated:: 3.3
606605
This method is deprecated in favour of :meth:`path_stats`. You don't
607606
have to implement it, but it is still available for compatibility
608-
purposes. If the path cannot be handled, raises an :exc:`OSError`
609-
or a :exc:`ValueError` depending on the reason.
607+
purposes. If the *path* cannot be handled, this raises an
608+
:exc:`OSError` or a :exc:`ValueError` depending on the reason.
610609

611610
.. versionchanged:: 3.4
612611
Raise :exc:`OSError` by default instead of :exc:`NotImplementedError`.

0 commit comments

Comments
 (0)