From f22737abfa07605f4ed1a99cfa97a26520b6c5c2 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 26 Jul 2021 09:18:19 -0700 Subject: The current documentation says it returns None if the name is not found, but (GH-26785) the implementation uses [] and will raise KeyError instead. Noticed by @srittau in python/typeshed@5659. --- Doc/library/sysconfig.rst | 2 +- Misc/NEWS.d/next/Documentation/2021-06-18-06-44-45.bpo-44453.3PIkj2.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Documentation/2021-06-18-06-44-45.bpo-44453.3PIkj2.rst diff --git a/Doc/library/sysconfig.rst b/Doc/library/sysconfig.rst index bb8e2d8..2de55d8 100644 --- a/Doc/library/sysconfig.rst +++ b/Doc/library/sysconfig.rst @@ -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 index 0000000..fd72cf5 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2021-06-18-06-44-45.bpo-44453.3PIkj2.rst @@ -0,0 +1 @@ +Fix documentation for the return type of :func:`sysconfig.get_path`. -- cgit v0.12