summaryrefslogtreecommitdiffstats
path: root/Modules/_testcapimodule.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-11/+0
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-31243: Fixed PyArg_ParseTuple failure checks. (#3171)Oren Milman2017-08-291-16/+30
|
* bpo-31173: Rewrite WSTOPSIG test of test_subprocess (#3055)Victor Stinner2017-08-101-0/+22
| | | | | | | | | | | | | The current test_child_terminated_in_stopped_state() function test creates a child process which calls ptrace(PTRACE_TRACEME, 0, 0) and then crash (SIGSEGV). The problem is that calling os.waitpid() in the parent process is not enough to close the process: the child process remains alive and so the unit test leaks a child process in a strange state. Closing the child process requires non-trivial code, maybe platform specific. Remove the functional test and replaces it with an unit test which mocks os.waitpid() using a new _testcapi.W_STOPCODE() function to test the WIFSTOPPED() path.
* bpo-30866: Add _testcapi.stack_pointer() (#2601)Victor Stinner2017-07-101-0/+8
|
* bpo-30695: Add set_nomemory(start, stop) to _testcapi (GH-2406)xdegaye2017-07-011-0/+128
|
* bpo-30054: Expose tracemalloc C API (#1236)Victor Stinner2017-06-201-5/+5
| | | | | | | | | * Make PyTraceMalloc_Track() and PyTraceMalloc_Untrack() functions public (remove the "_" prefix) * Remove the _PyTraceMalloc_domain_t type: use directly unsigned int. * Document methods Note: methods are already tested in test_tracemalloc.
* bpo-30524: Write unit tests for FASTCALL (#2022)Victor Stinner2017-06-091-0/+101
| | | | | | | Test C functions: * _PyObject_FastCall() * _PyObject_FastCallDict() * _PyObject_FastCallKeywords()
* bpo-30039: Don't run signal handlers while resuming a yield from stack (#1081)Nathaniel J. Smith2017-05-171-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have a chain of generators/coroutines that are 'yield from'ing each other, then resuming the stack works like: - call send() on the outermost generator - this enters _PyEval_EvalFrameDefault, which re-executes the YIELD_FROM opcode - which calls send() on the next generator - which enters _PyEval_EvalFrameDefault, which re-executes the YIELD_FROM opcode - ...etc. However, every time we enter _PyEval_EvalFrameDefault, the first thing we do is to check for pending signals, and if there are any then we run the signal handler. And if it raises an exception, then we immediately propagate that exception *instead* of starting to execute bytecode. This means that e.g. a SIGINT at the wrong moment can "break the chain" – it can be raised in the middle of our yield from chain, with the bottom part of the stack abandoned for the garbage collector. The fix is pretty simple: there's already a special case in _PyEval_EvalFrameEx where it skips running signal handlers if the next opcode is SETUP_FINALLY. (I don't see how this accomplishes anything useful, but that's another story.) If we extend this check to also skip running signal handlers when the next opcode is YIELD_FROM, then that closes the hole – now the exception can only be raised at the innermost stack frame. This shouldn't have any performance implications, because the opcode check happens inside the "slow path" after we've already determined that there's a pending signal or something similar for us to process; the vast majority of the time this isn't true and the new check doesn't run at all.
* bpo-30184: Add tests for invalid use of PyArg_ParseTupleAndKeywords. (#1316)Serhiy Storchaka2017-05-031-2/+2
|
* convert from long long to PyLong loselessly (#1106)Benjamin Peterson2017-04-131-1/+1
|
* fix an error message and a comment in _testcapimodule.c (GH-392)orenmn2017-03-021-2/+3
|
* bpo-29548: Fix some inefficient call API usage (GH-97)INADA Naoki2017-02-161-1/+1
|
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-2/+1
| | | | possible but Coccinelle couldn't find opportunity.
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-24/+12
| | | | possible. Patch is writen with Coccinelle.
* Issue #28822: Adjust indices handling of PyUnicode_FindChar().Xiang Zhang2016-12-201-0/+22
|
* Merge 3.6Victor Stinner2016-12-151-0/+14
|\
| * Fix a memory leak in split-table dictionariesVictor Stinner2016-12-151-0/+14
| | | | | | | | | | | | | | Issue #28147: Fix a memory leak in split-table dictionaries: setattr() must not convert combined table into split table. Patch written by INADA Naoki.
* | Use _PyObject_CallNoArg()Victor Stinner2016-12-061-1/+1
| | | | | | | | | | | | | | Replace: PyObject_CallObject(callable, NULL) with: _PyObject_CallNoArg(callable)
* | Issue #19569: Compiler warnings are now emitted if use most of deprecatedSerhiy Storchaka2016-11-201-8/+4
| | | | | | | | functions.
* | Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-1/+1
|\ \ | |/ | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-1/+1
| |\ | | | | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
| | * Issue #28701: Replace PyUnicode_CompareWithASCIIString with ↵Serhiy Storchaka2016-11-161-1/+1
| | | | | | | | | | | | | | | | | | _PyUnicode_EqualToASCIIString. The latter function is more readable, faster and doesn't raise exceptions.
* | | Issue #28123: _PyDict_GetItem_KnownHash() now can raise an exception asSerhiy Storchaka2016-11-061-0/+21
|\ \ \ | |/ / | | | | | | PyDict_GetItemWithError(). Patch by Xiang Zhang.
| * | Issue #28123: _PyDict_GetItem_KnownHash() now can raise an exception asSerhiy Storchaka2016-11-061-0/+21
| | | | | | | | | | | | PyDict_GetItemWithError(). Patch by Xiang Zhang.
* | | Issue #28379: Removed redundant check.Serhiy Storchaka2016-10-091-4/+0
|/ / | | | | | | Patch by Xiang Zhang.
* | Merge from 3.5.Serhiy Storchaka2016-10-081-0/+34
|\ \ | |/
| * Issue #28379: Added sanity checks and tests for PyUnicode_CopyCharacters().Serhiy Storchaka2016-10-081-0/+34
| | | | | | | | Patch by Xiang Zhang.
* | Issue #28295: Fixed the documentation and added tests for PyUnicode_AsUCS4().Serhiy Storchaka2016-10-021-0/+31
|\ \ | |/ | | | | Original patch by Xiang Zhang.
| * Issue #28295: Fixed the documentation and added tests for PyUnicode_AsUCS4().Serhiy Storchaka2016-10-021-0/+31
| | | | | | | | Original patch by Xiang Zhang.
| * Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter2016-09-071-1/+1
| |
* | Add a new private version to the builtin dict typeVictor Stinner2016-09-081-0/+16
| | | | | | | | | | | | | | Issue #26058: Add a new private version to the builtin dict type, incremented at each dictionary creation and at each dictionary change. Implementation of the PEP 509.
* | make sure expected values are interpreted as doublesBenjamin Peterson2016-09-081-1/+1
| |
* | replace Py_(u)intptr_t with the c99 standard typesBenjamin Peterson2016-09-061-8/+8
| |
* | replace Python aliases for standard integer types with the standard integer ↵Benjamin Peterson2016-09-061-8/+8
| | | | | | | | types (#17884)
* | require standard int types to be defined (#17884)Benjamin Peterson2016-09-061-8/+0
| |
* | replace PY_LONG_LONG with long longBenjamin Peterson2016-09-061-19/+19
| |
* | Avoid calling functions with an empty string as format stringVictor Stinner2016-09-061-2/+2
| | | | | | | | Directly pass NULL rather than an empty string.
* | require a long long data type (closes #27961)Benjamin Peterson2016-09-061-26/+2
| |
* | Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-301-1/+1
| |
* | Issue #26282: PyArg_ParseTupleAndKeywords() and Argument Clinic now supportSerhiy Storchaka2016-06-091-0/+18
| | | | | | | | positional-only and keyword parameters in the same function.
* | Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"Serhiy Storchaka2016-05-201-0/+95
|\ \ | |/ | | | | format unit.
| * Issue #26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"Serhiy Storchaka2016-05-201-0/+95
| | | | | | | | format unit.
* | Issue #26995: Added tests for "f", "d", "D", "S", "Y", and "U" format codesSerhiy Storchaka2016-05-161-0/+63
|\ \ | |/ | | | | in PyArg_ParseTuple().
| * Issue #26995: Added tests for "f", "d", "D", "S", "Y", and "U" format codesSerhiy Storchaka2016-05-161-0/+63
| | | | | | | | in PyArg_ParseTuple().
| * Backported tests for issue #18531.Serhiy Storchaka2016-05-161-0/+22
| |
* | Issue #18531: Single var-keyword argument of dict subtype was passedSerhiy Storchaka2016-05-081-0/+22
| | | | | | | | unscathed to the C-defined function. Now it is converted to exact dict.
* | Issue #26588: remove debug traces from _tracemalloc.Victor Stinner2016-03-221-14/+0
| |
* | Issue #26588: add debug tracesVictor Stinner2016-03-221-0/+14
| | | | | | | | Try to debug random failure on buildbots.
* | Add C functions _PyTraceMalloc_Track()Victor Stinner2016-03-221-0/+75
| | | | | | | | | | | | | | | | Issue #26530: * Add C functions _PyTraceMalloc_Track() and _PyTraceMalloc_Untrack() to track memory blocks using the tracemalloc module. * Add _PyTraceMalloc_GetTraceback() to get the traceback of an object.
* | Fail if PyMem_Malloc() is called without holding the GILVictor Stinner2016-03-161-0/+19
| | | | | | | | | | Issue #26563: Debug hooks on Python memory allocators now raise a fatal error if functions of the PyMem_Malloc() family are called without holding the GIL.