summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS2
-rwxr-xr-xTools/clinic/clinic.py1
2 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index a8e251a1e7..c3e8e88889 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -142,6 +142,8 @@ Tests
Tools/Demos
-----------
+- Issue #20376: Argument Clinic now escapes backslashes in docstrings.
+
- Issue #20381: Argument Clinic now sanity checks the default argument when
c_default is also specified, providing a nice failure message for
disallowed values.
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index d33abaed2a..7f1b059e80 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -120,6 +120,7 @@ def fail(*args, filename=None, line_number=None):
def quoted_for_c_string(s):
for old, new in (
+ ('\\', '\\\\'), # must be first!
('"', '\\"'),
("'", "\\'"),
):