[issue40642] Cpython "pystate.h" subdirectory wrong

2021-02-26 Thread Andrew Tomazos


Andrew Tomazos  added the comment:

The problem occurs if you:

   #include 

on *nix systems.  Note `/usr/include/` is in the system include path.  One 
workaround is to `-I/usr/include/python3.8` and then `#include `.  
Another workaround is to comment out:

   // #include "cpython/initconfig.h"

in `cpython/pystate.h`.

A fix would be appreciated, so that `#include ` would work 
out of the box (without having to add `-I`).

--
nosy: +andrewtomazos

___
Python tracker 
<https://bugs.python.org/issue40642>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40642] Cpython "pystate.h" subdirectory wrong

2021-02-26 Thread Andrew Tomazos


Andrew Tomazos  added the comment:

Related: https://stackoverflow.com/q/63211981/1131467

--

___
Python tracker 
<https://bugs.python.org/issue40642>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40642] Cpython "pystate.h" subdirectory wrong

2021-02-26 Thread Andrew Tomazos


Andrew Tomazos  added the comment:

After studying the include directives in the Include folder, I think the best 
fix would be:

In Include/cpython/state.h:

- #include "cpython/initconfig.h"
+ #include "initconfig.h"

this will mean that state.h will find initconfig.h using a file-relative 
include (as all the other include directives do), instead of relying on the 
installed Include directory being put in the header search path.

As this include directive is the only one with this property, the benefit of 
this change would be that the Include folder would be able to be installed in 
any subdirectory of a search path, rather than requiring its own dedicated one.

This would mean (for example) you could install different versions of the 
Python headers side by side and then select between them using preprocessor 
directives - rather than having to switch up global compiler options.

--

___
Python tracker 
<https://bugs.python.org/issue40642>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com