Skip to content

Commit 9c972b5

Browse files
kms70847Mariatta
authored andcommitted
Improve grammar in The Import System documentation (GH-1862)
Replace `an ModuleNotFoundError` with `a ModuleNotFoundError`. Replace `an path` with `a path`.
1 parent e405d4b commit 9c972b5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Doc/reference/import.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ implement import semantics.
3636

3737
When a module is first imported, Python searches for the module and if found,
3838
it creates a module object [#fnmo]_, initializing it. If the named module
39-
cannot be found, an :exc:`ModuleNotFoundError` is raised. Python implements various
39+
cannot be found, a :exc:`ModuleNotFoundError` is raised. Python implements various
4040
strategies to search for the named module when the import machinery is
4141
invoked. These strategies can be modified and extended by using various hooks
4242
described in the sections below.
@@ -167,7 +167,7 @@ arguments to the :keyword:`import` statement, or from the parameters to the
167167
This name will be used in various phases of the import search, and it may be
168168
the dotted path to a submodule, e.g. ``foo.bar.baz``. In this case, Python
169169
first tries to import ``foo``, then ``foo.bar``, and finally ``foo.bar.baz``.
170-
If any of the intermediate imports fail, an :exc:`ModuleNotFoundError` is raised.
170+
If any of the intermediate imports fail, a :exc:`ModuleNotFoundError` is raised.
171171

172172

173173
The module cache
@@ -185,7 +185,7 @@ object.
185185

186186
During import, the module name is looked up in :data:`sys.modules` and if
187187
present, the associated value is the module satisfying the import, and the
188-
process completes. However, if the value is ``None``, then an
188+
process completes. However, if the value is ``None``, then a
189189
:exc:`ModuleNotFoundError` is raised. If the module name is missing, Python will
190190
continue searching for the module.
191191

@@ -194,7 +194,7 @@ associated module (as other modules may hold references to it),
194194
but it will invalidate the cache entry for the named module, causing
195195
Python to search anew for the named module upon its next
196196
import. The key can also be assigned to ``None``, forcing the next import
197-
of the module to result in an :exc:`ModuleNotFoundError`.
197+
of the module to result in a :exc:`ModuleNotFoundError`.
198198

199199
Beware though, as if you keep a reference to the module object,
200200
invalidate its cache entry in :data:`sys.modules`, and then re-import the
@@ -298,7 +298,7 @@ The second argument is the path entries to use for the module search. For
298298
top-level modules, the second argument is ``None``, but for submodules or
299299
subpackages, the second argument is the value of the parent package's
300300
``__path__`` attribute. If the appropriate ``__path__`` attribute cannot
301-
be accessed, an :exc:`ModuleNotFoundError` is raised. The third argument
301+
be accessed, a :exc:`ModuleNotFoundError` is raised. The third argument
302302
is an existing module object that will be the target of loading later.
303303
The import system passes in a target module only during reload.
304304

@@ -616,7 +616,7 @@ the module.
616616
module.__path__
617617
---------------
618618

619-
By definition, if a module has an ``__path__`` attribute, it is a package,
619+
By definition, if a module has a ``__path__`` attribute, it is a package,
620620
regardless of its value.
621621

622622
A package's ``__path__`` attribute is used during imports of its subpackages.

0 commit comments

Comments
 (0)