mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-106046: Improve error message from os.fspath
if __fspath__
is set to None
(#106082)
This commit is contained in:
parent
8c24a83737
commit
93a970ffbc
5 changed files with 52 additions and 4 deletions
|
@ -3179,8 +3179,9 @@ An example of an asynchronous context manager class::
|
|||
lead to some very strange behaviour if it is handled incorrectly.
|
||||
|
||||
.. [#] The :meth:`~object.__hash__`, :meth:`~object.__iter__`,
|
||||
:meth:`~object.__reversed__`, and :meth:`~object.__contains__` methods have
|
||||
special handling for this; others
|
||||
:meth:`~object.__reversed__`, :meth:`~object.__contains__`,
|
||||
:meth:`~object.__class_getitem__` and :meth:`~os.PathLike.__fspath__`
|
||||
methods have special handling for this. Others
|
||||
will still raise a :exc:`TypeError`, but may do so by relying on
|
||||
the behavior that ``None`` is not callable.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue