From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Cc: Paul Koning <paulkoning@comcast.net>
Subject: Re: [PATCH] Fix compilation of python/python.c for Python 3.9
Date: Wed, 15 Apr 2020 11:14:53 -0700 [thread overview]
Message-ID: <20200415111453.14453278@f31-4.lan> (raw)
In-Reply-To: <CD60A2EE-A983-438C-ABCC-93A510081B94@comcast.net>
On Wed, 15 Apr 2020 14:02:32 -0400
Paul Koning <paulkoning@comcast.net> wrote:
> > On Apr 15, 2020, at 1:54 PM, Kevin Buettner via Gdb-patches <gdb-patches@sourceware.org> wrote:
> >
> > This commit fixes a compilation warning/error when building GDB
> > with Python 3.9:
> >
> > ...
> >
> > Specifically, with regard to PyEval_InitThreads(), it says:
> >
> > The PyEval_InitThreads() and PyEval_ThreadsInitialized() functions
> > are now deprecated and will be removed in Python 3.11. Calling
> > PyEval_InitThreads() now does nothing. The GIL is initialized by
> > Py_Initialize() since Python 3.7. (Contributed by Victor Stinner
> > in bpo-39877.)
> >
> > I chose to disable the call with a #if test using PY_VERSION_HEX.
>
> > ...
> > Py_Initialize ();
> > +#if PY_VERSION_HEX < 0x03090000
> > + /* PyEval_InitThreads became deprecated in Python 3.9 and will
> > + be removed in Python 3.11. Prior to Python 3.7, this call was
> > + required to initialize the GIL. */
> > PyEval_InitThreads ();
> > +#endif
>
> Since it is not needed as of 3.7, would it make sense for the #if to be on 0x03070000 instead?
It does make sense, and I'm willing to change it if that's the
consensus. I simply chose to use the version number where the call in
question became deprecated.
Kevin
next prev parent reply other threads:[~2020-04-15 18:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 17:54 Kevin Buettner
2020-04-15 18:02 ` Paul Koning
2020-04-15 18:14 ` Kevin Buettner [this message]
2020-04-15 21:11 ` Tom Tromey
2020-04-16 12:19 ` Kevin Buettner
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=20200415111453.14453278@f31-4.lan \
--to=kevinb@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=paulkoning@comcast.net \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).