New submission from STINNER Victor:

The issue #25150 modified pystate.h to hide _PyThreadState_Current. Sadly, this 
change broke the vmprof project:
https://mail.python.org/pipermail/python-dev/2016-January/142767.html

Attached patches adds a new private _PyThreadState_FastGet() function to get 
the current thread state but don't call Py_FatalError() if it is NULL.

The patch also uses replace direct access to _PyThreadState_Current with 
_PyThreadState_FastGet(), except inside ceval.c and pystate.c.

Calling Py_FatalError() to handle errors is not really a great API... Bad 
that's a different story, I don't want to break anything here.

I want to add the private function to Python 3.5.2 because I consider that the 
removal of the _PyThreadState_Current symbol is a regression introduced in 
Python 3.5.1.

We have no rule for the Python private API, it can change *anytime*.

----------
files: pythreadstate_fastget.patch
keywords: patch
messages: 258587
nosy: haypo, larry
priority: normal
severity: normal
status: open
title: Add private _PyThreadState_FastGet() to get the current thread state
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41660/pythreadstate_fastget.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26154>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to