mirror of
https://github.com/python/cpython.git
synced 2025-11-14 15:56:48 +00:00
Let’s keep “throw” for the generator method and use “raise” elsewhere.
This commit is contained in:
parent
827fdaae30
commit
ff2a4ba78c
4 changed files with 4 additions and 4 deletions
|
|
@ -320,7 +320,7 @@ However, there are a few differences that should be taken into account:
|
||||||
the default value to be visible again. Trying to delete a default value
|
the default value to be visible again. Trying to delete a default value
|
||||||
causes a ``KeyError``.
|
causes a ``KeyError``.
|
||||||
|
|
||||||
* Trying to delete the ``DEFAULTSECT`` throws ``ValueError``.
|
* Trying to delete the ``DEFAULTSECT`` raises ``ValueError``.
|
||||||
|
|
||||||
* There are two parser-level methods in the legacy API that hide the dictionary
|
* There are two parser-level methods in the legacy API that hide the dictionary
|
||||||
interface and are incompatible:
|
interface and are incompatible:
|
||||||
|
|
|
||||||
|
|
@ -1150,7 +1150,7 @@ Files and Directories
|
||||||
single: UNC paths; and os.makedirs()
|
single: UNC paths; and os.makedirs()
|
||||||
|
|
||||||
Recursive directory creation function. Like :func:`mkdir`, but makes all
|
Recursive directory creation function. Like :func:`mkdir`, but makes all
|
||||||
intermediate-level directories needed to contain the leaf directory. Throws
|
intermediate-level directories needed to contain the leaf directory. Raises
|
||||||
an :exc:`error` exception if the leaf directory already exists or cannot be
|
an :exc:`error` exception if the leaf directory already exists or cannot be
|
||||||
created. The default *mode* is ``0o777`` (octal). On some systems, *mode*
|
created. The default *mode* is ``0o777`` (octal). On some systems, *mode*
|
||||||
is ignored. Where it is used, the current umask value is first masked out.
|
is ignored. Where it is used, the current umask value is first masked out.
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ function for information about the exceptions it can raise.
|
||||||
will only need to be aware of the simple string values.
|
will only need to be aware of the simple string values.
|
||||||
|
|
||||||
Note that the functions :func:`compilest`, :func:`expr`, and :func:`suite` may
|
Note that the functions :func:`compilest`, :func:`expr`, and :func:`suite` may
|
||||||
raise exceptions which are normally thrown by the parsing and compilation
|
raise exceptions which are normally raised by the parsing and compilation
|
||||||
process. These include the built in exceptions :exc:`MemoryError`,
|
process. These include the built in exceptions :exc:`MemoryError`,
|
||||||
:exc:`OverflowError`, :exc:`SyntaxError`, and :exc:`SystemError`. In these
|
:exc:`OverflowError`, :exc:`SyntaxError`, and :exc:`SystemError`. In these
|
||||||
cases, these exceptions carry all the meaning normally associated with them.
|
cases, these exceptions carry all the meaning normally associated with them.
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ passed in, the result will contain only :class:`bytes` data.
|
||||||
|
|
||||||
Attempting to mix :class:`str` data with :class:`bytes` or
|
Attempting to mix :class:`str` data with :class:`bytes` or
|
||||||
:class:`bytearray` in a single function call will result in a
|
:class:`bytearray` in a single function call will result in a
|
||||||
:exc:`TypeError` being thrown, while attempting to pass in non-ASCII
|
:exc:`TypeError` being raised, while attempting to pass in non-ASCII
|
||||||
byte values will trigger :exc:`UnicodeDecodeError`.
|
byte values will trigger :exc:`UnicodeDecodeError`.
|
||||||
|
|
||||||
To support easier conversion of result objects between :class:`str` and
|
To support easier conversion of result objects between :class:`str` and
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue