gh-103997: Automatically dedent the argument to "-c" (#103998)

Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <80244920+Eclips4@users.noreply.github.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
Jon Crall 2025-04-18 04:39:30 -04:00 committed by GitHub
parent 50e518e886
commit fc0ec29889
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 266 additions and 0 deletions

View file

@ -247,6 +247,12 @@ extern Py_ssize_t _PyUnicode_InsertThousandsGrouping(
Py_UCS4 *maxchar,
int forward);
/* Dedent a string.
Behaviour is expected to be an exact match of `textwrap.dedent`.
Return a new reference on success, NULL with exception set on error.
*/
extern PyObject* _PyUnicode_Dedent(PyObject *unicode);
/* --- Misc functions ----------------------------------------------------- */
extern PyObject* _PyUnicode_FormatLong(PyObject *, int, int, int);