backport: #20145: assert[Raises|Warns]Regex now raise TypeError on bad regex.
Previously a non-string, non-regex second argument and missing callable
argument could cause the test to appear to always pass.
Initial patch by Kamilla Holanda.
diff --git a/Misc/ACKS b/Misc/ACKS
index 68617ce..0eb8267 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -546,6 +546,7 @@
Albert Hofkamp
Tomas Hoger
Jonathan Hogg
+Kamilla Holanda
Steve Holden
Akintayo Holder
Thomas Holenstein
diff --git a/Misc/NEWS b/Misc/NEWS
index 2a7cd3b..b00a017 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -24,6 +24,9 @@
Library
-------
+- Issue #20145: `assertRaisesRegex` and `assertWarnsRegex` now raise a
+ TypeError if the second argument is not a string or compiled regex.
+
- Issue #21058: Fix a leak of file descriptor in
:func:`tempfile.NamedTemporaryFile`, close the file descriptor if
:func:`io.open` fails