From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id 96BC7385DC23 for ; Wed, 15 Apr 2020 18:14:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 96BC7385DC23 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-478-Ke9GwZ_7P7mb47MOazpNeQ-1; Wed, 15 Apr 2020 14:14:55 -0400 X-MC-Unique: Ke9GwZ_7P7mb47MOazpNeQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ACF5F1088380; Wed, 15 Apr 2020 18:14:54 +0000 (UTC) Received: from f31-4.lan (ovpn-112-106.phx2.redhat.com [10.3.112.106]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C43A1001B3F; Wed, 15 Apr 2020 18:14:54 +0000 (UTC) Date: Wed, 15 Apr 2020 11:14:53 -0700 From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Paul Koning Subject: Re: [PATCH] Fix compilation of python/python.c for Python 3.9 Message-ID: <20200415111453.14453278@f31-4.lan> In-Reply-To: References: <20200415175434.7055-1-kevinb@redhat.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Apr 2020 18:14:58 -0000 On Wed, 15 Apr 2020 14:02:32 -0400 Paul Koning wrote: > > On Apr 15, 2020, at 1:54 PM, Kevin Buettner via Gdb-patches 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