Commit Graph

47 Commits

Author SHA1 Message Date
Christian Tismer ea62ce7f4f bpo-33738: Fix macros which contradict PEP 384 (GH-7477)
During development of the limited API support for PySide,
we saw an error in a macro that accessed a type field.

This patch fixes the 7 errors in the Python headers.
Macros which were not written as capitals were implemented
as function.

To do the necessary analysis again, a script was included that
parses all headers and looks for "->tp_" in serctions which can
be reached with active limited API.

It is easily possible to call this script as a test.

Error listing:

../../Include/objimpl.h:243
#define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \
    (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o)))
Action: commented only

../../Include/objimpl.h:362
#define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0)
Action: commented only

../../Include/objimpl.h:364
#define PyObject_GET_WEAKREFS_LISTPTR(o) \
    ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset))
Action: commented only

../../Include/pyerrors.h:143
#define PyExceptionClass_Name(x) \
     ((char *)(((PyTypeObject*)(x))->tp_name))
Action: implemented function

../../Include/abstract.h:593
#define PyIter_Check(obj) \
    ((obj)->ob_type->tp_iternext != NULL && \
     (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented)
Action: implemented function

../../Include/abstract.h:713
#define PyIndex_Check(obj)                              \
    ((obj)->ob_type->tp_as_number != NULL &&            \
     (obj)->ob_type->tp_as_number->nb_index != NULL)
Action: implemented function

../../Include/abstract.h:924
#define PySequence_ITEM(o, i)\
    ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) )
Action: commented only
2018-06-09 14:32:25 -04:00
Serhiy Storchaka 4e29f566e8
Add missed details of the C API introduced in 3.7. (GH-7047)
* Set the limited API version for PyImport_GetModule and PyOS_*Fork
  functions.
* Add PyImport_GetModule and Py_UTF8Mode in PC/python3.def.
* Add several functions in Doc/data/refcounts.dat.
2018-05-22 20:59:42 +03:00
Ned Deily 5489bdad51 Start of 3.8.0a0 2018-01-31 17:44:09 -05:00
xdegaye 56d1f5ca32 bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327) 2017-10-26 15:09:06 +02:00
Masayuki Yamamoto 731e189014 bpo-25658: Implement PEP 539 for Thread Specific Storage (TSS) API (GH-1362)
See PEP 539 for details.

Highlights of changes:

- Add Thread Specific Storage (TSS) API
- Document the Thread Local Storage (TLS) API as deprecated
- Update code that used TLS API to use TSS API
2017-10-06 20:41:34 +10:00
Eric Snow e377416c10 bpo-29102: Add a unique ID to PyInterpreterState. (#1639) 2017-05-22 19:46:40 -07:00
Serhiy Storchaka 6e08baf12d Issue #27867: Function PySlice_GetIndicesEx() is deprecated and replaced with
a macro if Py_LIMITED_API is not set or set to the value between 0x03050400
and 0x03060000 (not including) or 0x03060100 or higher.  Added functions
PySlice_Unpack() and PySlice_AdjustIndices().
2017-01-25 13:27:44 +02:00
Serhiy Storchaka 512c57cb72 Issue #27867: Function PySlice_GetIndicesEx() is replaced with a macro if
Py_LIMITED_API is not set or set to the value between 0x03050400
and 0x03060000 (not including) or 0x03060100 or higher.
2017-01-25 13:25:52 +02:00
Serhiy Storchaka b2a5be0763 Issue #27867: Function PySlice_GetIndicesEx() is replaced with a macro if
Py_LIMITED_API is not set or set to the value between 0x03050400
and 0x03060000 (not including) or 0x03060100 or higher.
2017-01-25 13:23:05 +02:00
Serhiy Storchaka 683cb8347a Issue #23903: Added missed Windows-specific names to PC/python3.def. 2016-12-27 17:44:18 +02:00
Serhiy Storchaka 32665009c3 Issue #23903: Added missed Windows-specific names to PC/python3.def. 2016-12-27 17:41:07 +02:00
Serhiy Storchaka e721be1faa Issue #23903: Added missed Windows-specific names to PC/python3.def. 2016-12-27 17:38:16 +02:00
Serhiy Storchaka fd54a74539 Issue #23903: Added missed names to PC/python3.def. 2016-12-27 12:17:41 +02:00
Serhiy Storchaka c70081cfc1 Issue #23903: Added missed names to PC/python3.def. 2016-12-27 12:13:05 +02:00
Serhiy Storchaka 6664e8c741 Issue #23903: Added missed names to PC/python3.def. 2016-12-27 12:10:58 +02:00
Serhiy Storchaka b6dc37e88d Issue #23903: Fixed errors and remove non-existing names in python3.def. 2016-12-27 11:51:56 +02:00
Serhiy Storchaka 26f15a430f Issue #23903: Fixed errors and remove non-existing names in python3.def. 2016-12-27 11:51:15 +02:00
Serhiy Storchaka d54d3d3d90 Issue #23903: Fixed errors and remove non-existing names in python3.def. 2016-12-27 11:49:53 +02:00
Serhiy Storchaka 1dd81012e9 Sort and remove duplicates from PC/python3.def (issue #23903). 2016-12-23 22:13:29 +02:00
Serhiy Storchaka 0dc1fa6d22 Sort and remove duplicates from PC/python3.def (issue #23903). 2016-12-23 22:11:57 +02:00
Serhiy Storchaka ab23347916 Sort and remove duplicates from PC/python3.def (issue #23903). 2016-12-23 22:09:48 +02:00
Ned Deily 4829bc6619 Bump to 3.7.0a0 2016-09-12 17:29:04 -04:00
Martin Panter b4ce1fc31b Issue #5319: New Py_FinalizeEx() API to exit with status 120 on failure 2015-11-30 03:18:29 +00:00
Eric Snow 06a6a83826 Issue #16991: Use the correct version for master. 2015-05-30 14:34:10 -06:00
Eric Snow 59b2f6803c Merge from 3.5. 2015-05-30 14:26:40 -06:00
Eric Snow f3b73ad51d Issue #16991: Add PyODict* to Windows builds. 2015-05-30 14:19:27 -06:00
Yury Selivanov 7aa5341164 Reverting my previous commit.
Something went horribly wrong when I was doing `hg rebase`.
2015-05-30 10:57:56 -04:00
Zachary Ware 41a6a625d4 Update Windows build for 3.6 2015-05-28 17:30:03 -05:00
Steve Dower 11d7b1423f Issue #24268: Adds PyModuleDef_Init and PyModuleDef_Type to python3.def (stable ABI) 2015-05-23 14:44:37 -07:00
Steve Dower 65e4cb10d9 Issue #22919: Windows build updated to support VC 14.0 (Visual Studio 2015), which will be used for the official 3.5 release. 2014-11-22 12:54:57 -08:00
Antoine Pitrou 0676a406bf Issue #18711: Add a new `PyErr_FormatV` function, similar to `PyErr_Format` but accepting a `va_list` argument. 2014-09-30 21:16:27 +02:00
Zachary Ware 6373ba5199 Bump Windows build to 3.5 2014-03-17 15:57:38 -05:00
Larry Hastings 71d4e44fd7 Add PyType_GetSlot to python3 def file. Patch courtesy Martin v. Löwis. 2014-02-10 14:40:04 -08:00
Martin v. Löwis 6087646ec0 Merge with 3.3: Issue #17432: Drop UCS2 from names of Unicode functions in python3.def. 2014-01-04 10:06:28 +01:00
Martin v. Löwis 7476289873 Issue #17432: Drop UCS2 from names of Unicode functions in python3.def. 2014-01-04 10:01:42 +01:00
Andrew Svetlov 3ba3a3ee56 Issue #15422: get rid of PyCFunction_New macro 2012-12-25 13:32:35 +02:00
Georg Brandl 08a9012352 Bump version to 3.4.0 alpha 0. 2012-09-29 09:34:13 +02:00
Martin v. Löwis 75aeaa9b18 Issue #11626: Add _SizeT functions to stable ABI. 2012-06-24 00:00:30 +02:00
Martin v. Löwis 9c56409d33 Issue #15146: Add PyType_FromSpecWithBases. Patch by Robin Schreiber. 2012-06-23 23:20:45 +02:00
Martin v. Löwis 7800f75827 Issue #15042: Add PyState_AddModule and PyState_RemoveModule.
Add version  guard for Py_LIMITED_API additions.
Issue #15081: Document PyState_FindModule.
Patch by Robin Schreiber.
2012-06-22 12:20:55 +02:00
Antoine Pitrou 71219dad3e More eol-style's 2011-02-25 14:31:09 +00:00
Georg Brandl fa2c61a222 More automated version replacement. 2011-02-20 10:41:31 +00:00
Martin v. Löwis 738236dbd6 Issue #11067: Add PyType_GetFlags, to support PyUnicode_Check
in the limited ABI
2011-02-05 20:35:29 +00:00
Martin v. Löwis d77520a426 Issue #11118: Fix bogus export of None in python3.dll. 2011-02-04 19:09:02 +00:00
Martin v. Löwis c83bc3c1fb Remove buffer API from stable ABI for now, see #10181. 2011-01-06 19:15:47 +00:00
Martin v. Löwis 0d012f284b Expose CompileString, not CompileStringFlags under the
limited API.
2010-12-04 12:00:49 +00:00
Martin v. Löwis 4d0d471a80 Merge branches/pep-0384. 2010-12-03 20:14:31 +00:00