diff options
author | Michael J. Sullivan <sully@msully.net> | 2019-05-22 20:43:37 (GMT) |
---|---|---|
committer | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-05-22 20:43:36 (GMT) |
commit | d8a82e2897b735e2b7e9e086f1d709365a2ad72c (patch) | |
tree | 205e3c569ca3d23346a4a8e3aa7bba46d352a7df /Lib | |
parent | 0c2b6a3943aa7b022e8eb4bfd9bffcddebf9a587 (diff) | |
download | cpython-d8a82e2897b735e2b7e9e086f1d709365a2ad72c.zip cpython-d8a82e2897b735e2b7e9e086f1d709365a2ad72c.tar.gz cpython-d8a82e2897b735e2b7e9e086f1d709365a2ad72c.tar.bz2 |
bpo-36878: Only allow text after `# type: ignore` if first character ASCII (GH-13504)
This disallows things like `# type: ignoreƩ`, which seems wrong.
Also switch to using Py_ISALNUM for the alnum check, for consistency
with other code (and maybe correctness re: locale issues?).
https://bugs.python.org/issue36878
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_type_comments.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_type_comments.py b/Lib/test/test_type_comments.py index c62894f..83d8717 100644 --- a/Lib/test/test_type_comments.py +++ b/Lib/test/test_type_comments.py @@ -334,6 +334,7 @@ class TypeCommentTests(unittest.TestCase): check_both_ways("try: # type: int\n pass\nfinally:\n pass\n") check_both_ways("try:\n pass\nfinally: # type: int\n pass\n") check_both_ways("pass # type: ignorewhatever\n") + check_both_ways("pass # type: ignoreƩ\n") def test_func_type_input(self): |