FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-133336: Remove reserved ``-J`` flag for Jython by AA-Turner · Pull Request #133444 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) .rst  (4) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
16 changes: 7 additions & 9 deletions Doc/using/cmdline.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,13 @@ Miscellaneous options
.. versionchanged:: 3.10
Removed the ``-X oldparser`` option.

.. versionremoved:: next

:option:`!-J` is no longer reserved for use by Jython_,
and now has no special meaning.
Comment thread
AA-Turner marked this conversation as resolved.

.. _Jython: https://www.jython.org/

.. _using-on-controlling-color:

Controlling color
Expand All @@ -694,15 +701,6 @@ output. To control the color output only in the Python interpreter, the
precedence over ``NO_COLOR``, which in turn takes precedence over
``FORCE_COLOR``.

Options you shouldn't use
~~~~~~~~~~~~~~~~~~~~~~~~~

.. option:: -J

Reserved for use by Jython_.

.. _Jython: https://www.jython.org/


.. _using-on-envvars:

Expand Down
2 changes: 1 addition & 1 deletion Doc/whatsnew/2.6.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ Interpreter Changes
-------------------------------

Two command-line options have been reserved for use by other Python
implementations. The :option:`-J` switch has been reserved for use by
implementations. The :option:`!-J` switch has been reserved for use by
Jython for Jython-specific options, such as switches that are passed to
the underlying JVM. :option:`-X` has been reserved for options
specific to a particular implementation of Python such as CPython,
Expand Down
5 changes: 5 additions & 0 deletions Doc/whatsnew/3.14.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,11 @@ Other language changes
:keyword:`async with`).
(Contributed by Bénédikt Tran in :gh:`128398`.)

* :option:`!-J` is no longer a reserved flag for Jython_,
and now has no special meaning.
(Contributed by Adam Turner in :gh:`133336`.)

.. _Jython: https://www.jython.org/

.. _whatsnew314-pep765:

Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:option:`!-J` is no longer reserved for use by Jython.
Comment thread
AA-Turner marked this conversation as resolved.
Patch by Adam Turner.
9 changes: 1 addition & 8 deletions Python/getopt.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static const wchar_t *opt_ptr = L"";

/* Python command line short and long options */

#define SHORT_OPTS L"bBc:dEhiIJm:OPqRsStuvVW:xX:?"
#define SHORT_OPTS L"bBc:dEhiIm:OPqRsStuvVW:xX:?"

static const _PyOS_LongOption longopts[] = {
/* name, has_arg, val (used in switch in initconfig.c) */
Expand Down Expand Up @@ -133,13 +133,6 @@ int _PyOS_GetOpt(Py_ssize_t argc, wchar_t * const *argv, int *longindex)
return opt->val;
}

if (option == 'J') {
if (_PyOS_opterr) {
fprintf(stderr, "-J is reserved for Jython\n");
}
return '_';
}

if ((ptr = wcschr(SHORT_OPTS, option)) == NULL) {
if (_PyOS_opterr) {
fprintf(stderr, "Unknown option: -%c\n", (char)option);
Expand Down

Back | FazBrowse Home | New Git URL