Closed rathann closed 6 months ago
unistd.h
was added back into Python.h
in python/cpython#112026. So this is no longer needed.
It will be needed for Python 3.14, though, as the upstream discussion indicates the intention to re-land the changes then.
This fixes the following compilation error with Python 3.13.0a1:
According to https://docs.python.org/3.13/whatsnew/3.13.html:
Python.h
no longer includes the<unistd.h>
standard header file. If needed, it should now be included explicitly. For example, it provides the functions:read()
,write()
,close()
,isatty()
,lseek()
,getpid()
,getcwd()
,sysconf()
andgetpagesize()
. As a consequence,_POSIX_SEMAPHORES
and_POSIX_THREADS
macros are no longer defined byPython.h
. TheHAVE_UNISTD_H
andHAVE_PTHREAD_H
macros defined byPython.h
can be used to decide if<unistd.h>
and<pthread.h>
header files can be included.See https://github.com/python/cpython/pull/108783 .