Skip to content

Commit adb7884

Browse files
Review
1 parent 5e5c010 commit adb7884

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

Doc/using/cmdline.rst

Lines changed: 2 additions & 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

@@ -75,6 +75,7 @@ source.
7575

7676
.. versionchanged:: 3.14
7777
*command* is automatically dedented before execution.
78+
Only supports spaces and tabs and doesn't normalize empty lines.
7879

7980
.. option:: -m <module-name>
8081

Doc/whatsnew/3.14.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,8 @@ Other language changes
11881188
(Contributed by Tomasz Pytel in :gh:`132329`.)
11891189

11901190
* The command-line option :option:`-c` now automatically dedents its code
1191-
argument before execution.
1191+
argument before execution. Only supports spaces and tabs and doesn't
1192+
normalize empty lines.
11921193
(Contributed by Jon Crall and Steven Sun in :gh:`103998`.)
11931194

11941195
* Improve error message when an object supporting the synchronous

Include/internal/pycore_unicodeobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ extern Py_ssize_t _PyUnicode_InsertThousandsGrouping(
258258
int forward);
259259

260260
/* Dedent a string.
261+
Only supports spaces and tabs and doesn't normalize empty lines.
261262
Return a new reference on success, NULL with exception set on error.
262263
*/
263264
extern PyObject* _PyUnicode_Dedent(PyObject *unicode);

Misc/NEWS.d/3.14.0b1.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,6 +1882,7 @@ Improve error message when :exc:`TypeError` occurs during
18821882
.. section: Core and Builtins
18831883
18841884
String arguments passed to "-c" are now automatically dedented.
1885+
Only supports spaces and tabs and doesn't normalize empty lines.
18851886
This allows "python -c" invocations to be indented
18861887
in shell scripts without causing indentation errors. (Patch by Jon Crall and
18871888
Steven Sun)

Objects/unicodeobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14389,6 +14389,7 @@ search_longest_common_leading_whitespace(
1438914389
}
1439014390

1439114391
/* Dedent a string.
14392+
Only supports spaces and tabs and doesn't normalize empty lines.
1439214393
Return a new reference on success, NULL with exception set on error.
1439314394
*/
1439414395
PyObject *

0 commit comments

Comments
 (0)