| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
(stable ABI)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Known limitations of the current implementation:
- documentation changes are incomplete
- there's a reference leak I haven't tracked down yet
The leak is most visible by running:
./python -m test -R3:3 test_importlib
However, you can also see it by running:
./python -X showrefcount
Importing the array or _testmultiphase modules, and
then deleting them from both sys.modules and the local
namespace shows significant increases in the total
number of active references each cycle. By contrast,
with _testcapi (which continues to use single-phase
initialisation) the global refcounts stabilise after
a couple of cycles.
|
|
|
|
|
|
|
| |
Replaces the PyList_GET_ITEM and PyList_SET_ITEM macros with normal array
accesses. Replace the siftup unpredicatable branch with arithmetic.
Replace the rc == -1 tests with rc < 0. Gives nicer looking assembly
with both Clang and GCC-4.9. Also gives a small performance both for both.
|
|
|
|
|
|
| |
now is
deprecated. Based on patch by Mark Dickinson.
|
| |
|
| |
|
|
|
|
| |
Closes issue #22906.
|
|
|
|
| |
Patch by Neil Girdhar.
|
|
|
|
| |
it can't happen anymore
|
|
|
|
| |
hg status should be my friend more often...
|
|\ |
|
| |\
| | |
| | |
| | |
| | |
| | | |
on Windows instead of silently truncate them.
Removed no longer used _PyUnicode_HasNULChars().
|
| | | |
|
|/ / |
|
|\ \
| |/ |
|
| | |
|
| |\ |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
_set_thread_local_invalid_parameter_handler.
|
| | |
| | |
| | |
| | | |
Use -1 second by default, not -1 nanosecond.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Fix also _Py_InitializeEx_Private(): initialize time before initializing
import, import_init() uses the _PyTime API (for thread locks).
|
| | |
| | |
| | |
| | |
| | | |
Helper to write() which retries write() if it is interrupted by a signal (fails
with EINTR).
|
| | | |
|
| | | |
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | | |
Add _Py_fstat_noraise() function when a Python exception is not welcome.
|
| | | |
| | | |
| | | |
| | | | |
Use _PyTime_ROUND_FLOOR and _PyTime_ROUND_CEILING instead.
|
| | | |
| | | |
| | | |
| | | | |
Add also more tests for ROUNd_FLOOR.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Add _PyTime_AsTimeval_noraise() function. Call it when it's not possible (or
not useful) to raise a Python exception on overflow.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
* Remove _PyTime_gettimeofday()
* Add _PyTime_GetSystemClock()
|
|/ / / |
|
| | |
| | |
| | |
| | |
| | | |
module. time.clock_settime() now uses this rounding method instead of
_PyTime_ROUND_DOWN to handle correctly dates before 1970.
|
| | |
| | |
| | |
| | | |
Remove also the now unused _PyTime_AddDouble() function.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add also a new _PyTime_AsMicroseconds() function.
threading.TIMEOUT_MAX is now be smaller: only 292 years instead of 292,271
years on 64-bit system for example. Sorry, your threads will hang a *little
bit* shorter. Call me if you want to ensure that your locks wait longer, I can
share some tricks with you.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
* _PyTime_AsTimeval() now ensures that tv_usec is always positive
* _PyTime_AsTimespec() now ensures that tv_nsec is always positive
* _PyTime_AsTimeval() now returns an integer on overflow instead of raising an
exception
|
| | |
| | |
| | |
| | |
| | | |
* Add _PyTime_AsTimespec()
* Add unit tests for _PyTime_AsTimespec()
|
| | |
| | |
| | |
| | | |
* Add _PyTime_GetSystemClockWithInfo()
|
| | |
| | |
| | |
| | |
| | |
| | | |
* Add _PyTime_FromNanoseconds()
* Add _PyTime_AsSecondsDouble()
* Add unit tests for _PyTime_AsSecondsDouble()
|
| | |
| | |
| | |
| | |
| | |
| | | |
* Rename _PyTime_FromObject() to _PyTime_FromSecondsObject()
* Add _PyTime_AsNanosecondsObject() and _testcapi.pytime_fromsecondsobject()
* Add unit tests
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In practice, _PyTime_t is a number of nanoseconds. Its C type is a 64-bit
signed number. It's integer value is in the range [-2^63; 2^63-1]. In seconds,
the range is around [-292 years; +292 years]. In term of Epoch timestamp
(1970-01-01), it can store a date between 1677-09-21 and 2262-04-11.
The API has a resolution of 1 nanosecond and use integer number. With a
resolution on 1 nanosecond, 64-bit IEEE 754 floating point numbers loose
precision after 194 days. It's not the case with this API. The drawback is
overflow for values outside [-2^63; 2^63-1], but these values are unlikely for
most Python modules, except of the datetime module.
New functions:
- _PyTime_GetMonotonicClock()
- _PyTime_FromObject()
- _PyTime_AsMilliseconds()
- _PyTime_AsTimeval()
This change uses these new functions in time.sleep() to avoid rounding issues.
The new API will be extended step by step, and the old API will be removed step
by step. Currently, some code is duplicated just to be able to move
incrementally, instead of pushing a large change at once.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I expected more users of _Py_wstat(), but in practice it's only used by
Modules/getpath.c. Move the function because it's not needed on Windows.
Windows uses PC/getpathp.c which uses the Win32 API (ex: GetFileAttributesW())
not the POSIX API.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
fstat(), these functions are always required.
Remove HAVE_STAT and HAVE_FSTAT defines, and stop supporting DONT_HAVE_STAT and
DONT_HAVE_FSTAT.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
which returned an invalid result (result+error or no result without error) in
the exception message.
Add also unit test to check that the exception contains the name of the
function.
Special case: the final _PyEval_EvalFrameEx() check doesn't mention the
function since it didn't execute a single function but a whole frame.
|
| | | |
|