From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH v3] Handle Python 3.11 deprecation of PySys_SetPath and Py_SetProgramName
Date: Mon, 18 Jul 2022 11:49:48 -0400 [thread overview]
Message-ID: <5013d7ce-5e1e-ade9-d41f-32a15e1a5de8@simark.ca> (raw)
In-Reply-To: <20220715215814.246906-1-kevinb@redhat.com>
> @@ -1849,6 +1855,24 @@ show_python_dont_write_bytecode (struct ui_file *file, int from_tty,
> value);
> }
>
> +/* Return value to assign to PyConfig.write_bytecode or, when
> + negated (via !), Py_DontWriteBytecodeFlag. Py_DontWriteBytecodeFlag
> + is deprecated in Python 3.12. */
> +
> +static int
> +python_write_bytecode ()
> +{
> + int wbc = 0;
> +
> + if (python_dont_write_bytecode == AUTO_BOOLEAN_AUTO)
> + wbc = (!python_ignore_environment
> + && getenv ("PYTHONDONTWRITEBYTECODE") != nullptr) ? 0 : 1;
I think it predates your patch (so, orthogonal), but the Python doc says:
If this is set to a non-empty string, Python won’t try to write .pyc
files on the import of source modules.
So I think we would need a "non-empty string" check here?
Simon
next prev parent reply other threads:[~2022-07-18 15:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 21:58 Kevin Buettner via Gdb-patches
2022-07-18 15:28 ` Tom Tromey
2022-07-18 15:49 ` Simon Marchi via Gdb-patches [this message]
2022-07-20 19:19 ` Kevin Buettner via Gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5013d7ce-5e1e-ade9-d41f-32a15e1a5de8@simark.ca \
--to=gdb-patches@sourceware.org \
--cc=kevinb@redhat.com \
--cc=simark@simark.ca \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox