]> git.ipfire.org Git - thirdparty/unbound.git/commit
Py_NoSiteFlag is not needed since Python 3.8 1049/head
authorPetr Mensik <pemensik@redhat.com>
Mon, 15 Apr 2024 11:43:58 +0000 (13:43 +0200)
committerPetr Mensik <pemensik@redhat.com>
Mon, 15 Apr 2024 11:52:41 +0000 (13:52 +0200)
commitb11d234f774301c7deac9e76fc7496e4d0ab68d7
tree8e973f5fb185ecf2b9a91f0e91181614760b634e
parent0d4c5aa4219c1e7a237945405320c1183a40ec89
Py_NoSiteFlag is not needed since Python 3.8

Python since 3.12 prints warning about Py_NoSiteFlag is deprecated. It
seems that variable is not needed since Python 3.8, since it sets in
such cases directly config.site_import variable few moments later.
Move using deprecated variable to versions before that flag in config
could be used only.

This should fix warning like:

pythonmod/pythonmod.c: In function 'pythonmod_init':
pythonmod/pythonmod.c:359:7: warning: 'Py_NoSiteFlag' is deprecated [-Wdeprecated-declarations]
  359 |       Py_NoSiteFlag = 1;
      |       ^~~~~~~~~~~~~
In file included from /usr/include/python3.12/Python.h:48,
                 from pythonmod/pythonmod.c:54:
/usr/include/python3.12/cpython/pydebug.h:14:37: note: declared here
   14 | Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_NoSiteFlag;
      |                                     ^~~~~~~~~~~~~

https://docs.python.org/3/c-api/init.html#c.Py_NoSiteFlag
pythonmod/pythonmod.c