diff options
author | animalize <animalize@users.noreply.github.com> | 2019-02-24 23:18:48 (GMT) |
---|---|---|
committer | Inada Naoki <methane@users.noreply.github.com> | 2019-02-24 23:18:48 (GMT) |
commit | 463572c8beb59fd9d6850440af48a5c5f4c0c0c9 (patch) | |
tree | 643a8cee8377a871eac048685b0856c1abebc8bf /Tools | |
parent | 9e456bc70e7bc9ee9726d356d7167457e585fd4c (diff) | |
download | cpython-463572c8beb59fd9d6850440af48a5c5f4c0c0c9.zip cpython-463572c8beb59fd9d6850440af48a5c5f4c0c0c9.tar.gz cpython-463572c8beb59fd9d6850440af48a5c5f4c0c0c9.tar.bz2 |
bpo-36101: remove non-ascii characters in docstring (GH-12018)
* remove non-ascii characters in docstring
* clinic.py emits a warning when docstring has non-ascii character
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/clinic/clinic.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 7f435f1..f4f0017 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -615,6 +615,9 @@ class CLanguage(Language): return self.render_function(clinic, function) def docstring_for_c_string(self, f): + if re.search(r'[^\x00-\x7F]', f.docstring): + warn("Non-ascii character appear in docstring.") + text, add, output = _text_accumulator() # turn docstring into a properly quoted C string for line in f.docstring.split('\n'): |