]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
The current documentation says it returns None if the name is not found, but (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 26 Jul 2021 19:35:33 +0000 (12:35 -0700)
committerGitHub <noreply@github.com>
Mon, 26 Jul 2021 19:35:33 +0000 (21:35 +0200)
the implementation uses [] and will raise KeyError instead.

Noticed by @srittau in python/typeshed@5659.
(cherry picked from commit f22737abfa07605f4ed1a99cfa97a26520b6c5c2)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Doc/library/sysconfig.rst
Misc/NEWS.d/next/Documentation/2021-06-18-06-44-45.bpo-44453.3PIkj2.rst [new file with mode: 0644]

index bb8e2d88c0fc95342eece8ce9344e2bb622bece1..2de55d86c38f487ebefa37d45855506ca1004f59 100644 (file)
@@ -175,7 +175,7 @@ identifier.  Python currently uses eight paths:
    If *expand* is set to ``False``, the path will not be expanded using the
    variables.
 
-   If *name* is not found, return ``None``.
+   If *name* is not found, raise a :exc:`KeyError`.
 
 
 .. function:: get_paths([scheme, [vars, [expand]]])
diff --git a/Misc/NEWS.d/next/Documentation/2021-06-18-06-44-45.bpo-44453.3PIkj2.rst b/Misc/NEWS.d/next/Documentation/2021-06-18-06-44-45.bpo-44453.3PIkj2.rst
new file mode 100644 (file)
index 0000000..fd72cf5
--- /dev/null
@@ -0,0 +1 @@
+Fix documentation for the return type of :func:`sysconfig.get_path`.