Skip to content

Commit 5151826

Browse files
The current documentation says it returns None if the name is not found, but (GH-26785) (GH-27371)
the implementation uses [] and will raise KeyError instead. Noticed by @srittau in python/typeshed@5659. (cherry picked from commit f22737a) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
1 parent 563e057 commit 5151826

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/library/sysconfig.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ identifier. Python currently uses eight paths:
175175
If *expand* is set to ``False``, the path will not be expanded using the
176176
variables.
177177

178-
If *name* is not found, return ``None``.
178+
If *name* is not found, raise a :exc:`KeyError`.
179179

180180

181181
.. function:: get_paths([scheme, [vars, [expand]]])
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix documentation for the return type of :func:`sysconfig.get_path`.

0 commit comments

Comments
 (0)