mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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
This commit is contained in:
parent
9e456bc70e
commit
463572c8be
5 changed files with 14 additions and 11 deletions
|
@ -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'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue