Skip to content

Commit 463572c

Browse files
animalizemethane
animalize
authored andcommitted
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
1 parent 9e456bc commit 463572c

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

Modules/_curses_panel.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,12 @@ _curses_panel.panel.set_userptr
412412
obj: object
413413
/
414414
415-
Set the panels user pointer to obj.
415+
Set the panel's user pointer to obj.
416416
[clinic start generated code]*/
417417

418418
static PyObject *
419419
_curses_panel_panel_set_userptr(PyCursesPanelObject *self, PyObject *obj)
420-
/*[clinic end generated code: output=6fb145b3af88cf4a input=2056be1cd148b05c]*/
420+
/*[clinic end generated code: output=6fb145b3af88cf4a input=d2c6a9dbefabbf39]*/
421421
{
422422
PyObject *oldobj;
423423
int rc;
@@ -587,12 +587,12 @@ _curses_panel.update_panels
587587
588588
Updates the virtual screen after changes in the panel stack.
589589
590-
This does not call curses.doupdate(), so youll have to do this yourself.
590+
This does not call curses.doupdate(), so you'll have to do this yourself.
591591
[clinic start generated code]*/
592592

593593
static PyObject *
594594
_curses_panel_update_panels_impl(PyObject *module)
595-
/*[clinic end generated code: output=2f3b4c2e03d90ded input=a127069202b0a097]*/
595+
/*[clinic end generated code: output=2f3b4c2e03d90ded input=5299624c9a708621]*/
596596
{
597597
PyCursesInitialised;
598598
update_panels();

Modules/clinic/_curses_panel.c.h

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/clinic/context.c.h

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/context.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -592,12 +592,12 @@ _contextvars_Context_keys_impl(PyContext *self)
592592
/*[clinic input]
593593
_contextvars.Context.values
594594
595-
Return a list of all variables values in the context object.
595+
Return a list of all variables' values in the context object.
596596
[clinic start generated code]*/
597597

598598
static PyObject *
599599
_contextvars_Context_values_impl(PyContext *self)
600-
/*[clinic end generated code: output=d286dabfc8db6dde input=6c3d08639ba3bf67]*/
600+
/*[clinic end generated code: output=d286dabfc8db6dde input=ce8075d04a6ea526]*/
601601
{
602602
return _PyHamt_NewIterValues(self->ctx_vars);
603603
}

Tools/clinic/clinic.py

+3
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,9 @@ def render(self, clinic, signatures):
615615
return self.render_function(clinic, function)
616616

617617
def docstring_for_c_string(self, f):
618+
if re.search(r'[^\x00-\x7F]', f.docstring):
619+
warn("Non-ascii character appear in docstring.")
620+
618621
text, add, output = _text_accumulator()
619622
# turn docstring into a properly quoted C string
620623
for line in f.docstring.split('\n'):

0 commit comments

Comments
 (0)