bpo-36346: Make using the legacy Unicode C API optional (GH-21437)
Add compile time option USE_UNICODE_WCHAR_CACHE. Setting it to 0
makes the interpreter not using the wchar_t cache and the legacy Unicode C API.
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py
index d421be0..a92870c 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -250,9 +250,9 @@
self.assertRaises(OSError, writer.writerows, BadIterable())
@support.cpython_only
+ @support.requires_legacy_unicode_capi
def test_writerows_legacy_strings(self):
import _testcapi
-
c = _testcapi.unicode_legacy_string('a')
with TemporaryFile("w+", newline='') as fileobj:
writer = csv.writer(fileobj)