bpo-36346: Raise DeprecationWarning when creating legacy Unicode (GH-20933)

This commit is contained in:
Inada Naoki 2020-06-30 15:26:56 +09:00 committed by GitHub
parent 349f76c6aa
commit 038dd0f79d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 4 deletions

View file

@ -725,7 +725,9 @@ class UnicodeTest(string_tests.CommonTest,
import _testcapi
u = '𝖀𝖓𝖎𝖈𝖔𝖉𝖊'
self.assertTrue(u.isidentifier())
self.assertTrue(_testcapi.unicode_legacy_string(u).isidentifier())
with support.check_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
self.assertTrue(_testcapi.unicode_legacy_string(u).isidentifier())
def test_isprintable(self):
self.assertTrue("".isprintable())