Skip to content

Commit bdf0105

Browse files
gh-103997: Remove incorrect statements about -c dedenting (gh-138624)
1 parent 170d85a commit bdf0105

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

Doc/using/cmdline.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ additional methods of invocation:
4949
appropriately named script from that directory.
5050
* When called with ``-c command``, it executes the Python statement(s) given as
5151
*command*. Here *command* may contain multiple statements separated by
52-
newlines. Leading whitespace is significant in Python statements!
52+
newlines.
5353
* When called with ``-m module-name``, the given module is located on the
5454
Python module path and executed as a script.
5555

Doc/whatsnew/3.14.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -897,8 +897,7 @@ Command line and environment
897897
(Contributed by Noah Kim and Adam Turner in :gh:`118655`.)
898898

899899
* The command-line option :option:`-c` now automatically dedents its code
900-
argument before execution. The auto-dedentation behavior mirrors
901-
:func:`textwrap.dedent`.
900+
argument before execution.
902901
(Contributed by Jon Crall and Steven Sun in :gh:`103998`.)
903902

904903
* :option:`!-J` is no longer a reserved flag for Jython_,

Include/internal/pycore_unicodeobject.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ extern PyObject* _PyUnicode_XStrip(
326326

327327

328328
/* Dedent a string.
329-
Behaviour is expected to be an exact match of `textwrap.dedent`.
329+
Intended to dedent Python source. Unlike `textwrap.dedent`, this
330+
only supports spaces and tabs and doesn't normalize empty lines.
330331
Return a new reference on success, NULL with exception set on error.
331332
*/
332333
extern PyObject* _PyUnicode_Dedent(PyObject *unicode);

Misc/NEWS.d/3.14.0b1.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,8 +1881,8 @@ Improve error message when :exc:`TypeError` occurs during
18811881
.. nonce: BS3uVt
18821882
.. section: Core and Builtins
18831883
1884-
String arguments passed to "-c" are now automatically dedented as if by
1885-
:func:`textwrap.dedent`. This allows "python -c" invocations to be indented
1884+
String arguments passed to "-c" are now automatically dedented.
1885+
This allows "python -c" invocations to be indented
18861886
in shell scripts without causing indentation errors. (Patch by Jon Crall and
18871887
Steven Sun)
18881888

Objects/unicodeobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13581,7 +13581,8 @@ search_longest_common_leading_whitespace(
1358113581
}
1358213582

1358313583
/* Dedent a string.
13584-
Behaviour is expected to be an exact match of `textwrap.dedent`.
13584+
Intended to dedent Python source. Unlike `textwrap.dedent`, this
13585+
only supports spaces and tabs and doesn't normalize empty lines.
1358513586
Return a new reference on success, NULL with exception set on error.
1358613587
*/
1358713588
PyObject *

0 commit comments

Comments
 (0)