This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] python: Make Windows-specific code work with Python 3



> On Oct 30, 2018, at 4:28 PM, Jan Vrany <jan.vrany@fit.cvut.cz> wrote:
> 
> On Tue, 2018-10-30 at 14:08 -0600, Tom Tromey wrote:
>>>>>>> "Jan" == Jan Vrany <jan.vrany@fit.cvut.cz> writes:
>> 
>> Jan> Windows workaround in python_run_simple_file() used Python 2
>> Jan> APIs which were removed in Python 3. This commit adds a
>> Jan> conditionally compiled variant that uses Python 3 APIs.
>> 
>> Jan> +# ifdef IS_PY3K
>> Jan> +  FILE *python_file = _Py_fopen (full_path.get (), (char *) "r");
>> 
>> I'm a bit reluctant to rely on an undocumented API.
> 
> Me to, to be honest, but I could not find any other way...

I've been at the receiving end of grief for using a _Py_foo call.  It might stop working in some release and that would be a hassle.  You might ask on the Python list for advice.  Given what you're looking for there clearly has to be some approved way of doing this with just public APIs.

	paul



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]