| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
(#2639)
instead of failing with SystemError.
Relative import from non-package now fails with ImportError rather than
SystemError.
|
|
|
|
|
|
| |
* Rewrite importlib _get_module_lock(): it is now responsible to hold
the imp lock directly.
* _find_and_load() now holds the module lock to check if name is in
sys.modules to prevent a race condition
|
|
|
|
| |
(#2580)
|
|
|
|
| |
In rare circumstances PyImport_Import() could return NULL without raising
an error.
|
|
|
|
|
|
| |
* Doc nits for bpo-16500
* Fix more references
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-6532: Make the thread id an unsigned integer.
From C API side the type of results of PyThread_start_new_thread() and
PyThread_get_thread_ident(), the id parameter of
PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState
changed from "long" to "unsigned long".
* Restore a check in thread_get_ident().
|
|
|
|
| |
PyBool_FromLong(0)/PyBool_FromLong(1). (#567)
|
| |
|
|
|
|
| |
possible. Patch is writen with Coccinelle.
|
|
|
|
|
|
|
|
|
| |
Issue #28915: Replace _PyObject_CallMethodId() with
_PyObject_CallMethodIdObjArgs() in various modules when the format string was
only made of "O" formats, PyObject* arguments.
_PyObject_CallMethodIdObjArgs() avoids the creation of a temporary tuple and
doesn't have to parse a format string.
|
|
|
|
|
|
| |
Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like
_PyObject_CallArg1() uses more stack memory than
PyObject_CallFunctionObjArgs().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func)
* PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg)
PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires
extra work to "parse" C arguments to build a C array of PyObject*.
_PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate
memory on the C stack.
This change is part of the fastcall project. The change on listsort() is
related to the issue #23507.
|
|
|
|
| |
UTF-8 represenatation of Unicode objects.
|
|\
| |
| |
| |
| |
| | |
_PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
|
| |
| |
| |
| |
| |
| | |
_PyUnicode_EqualToASCIIString.
The latter function is more readable, faster and doesn't raise exceptions.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
PyModule_GetDef() can return NULL. Let's check the return value properly
like in the other five cases.
CID 1299590
|
| |
| |
| |
| | |
Thanks to Xiang Zhang for the patch.
|
| | |
|
|\ \
| |/ |
|
| | |
|
| | |
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/
| |
| |
| |
| | |
or builtins for importing submodules or "from import". Fixed a crash if
raise a warning about unabling to resolve package from __spec__ or
__package__.
|
| |
| |
| |
| |
| | |
or builtins for importing submodules or "from import". Fixed handling an
error of non-string package name.
|
| |
| |
| |
| | |
Thanks to Oren Milman for the patch.
|
|\ \
| |/
| |
| | |
generated by Argument Clinic. Patch by Petr Viktorin.
|
| |
| |
| |
| | |
generated by Argument Clinic. Patch by Petr Viktorin.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Replace PyUnicode_RPartition() with PyUnicode_FindChar() and
PyUnicode_Substring() to avoid the creation of a temporary tuple.
* Use PyUnicode_FromFormat() to build a string and avoid the single_dot ('.')
singleton
Thanks Serhiy Storchaka for your review.
|
| | |
|
|\ \
| |/ |
|
|\ \
| |/
| |
| | |
if the stack is too deep.
|
| |
| |
| |
| | |
if the stack is too deep.
|
| |
| |
| |
| |
| |
| |
| |
| | |
with no known parent package.
Previously SystemError was raised if the parent package didn't exist
(e.g., __package__ was set to '').
Thanks to Florent Xicluna and Yongzhi Pan for reporting the issue.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In a previous change, __spec__.parent was prioritized over
__package__. That is a backwards-compatibility break, but we do
eventually want __spec__ to be the ground truth for module details. So
this change reverts the change in semantics and instead raises an
ImportWarning when __package__ != __spec__.parent to give people time
to adjust to using spec objects.
|
| |
| |
| |
| |
| |
| |
| |
| | |
not defined for a relative import.
This is the start of work to try and clean up import semantics to rely
more on a module's spec than on the myriad attributes that get set on
a module. Thanks to Rose Ames for the patch.
|
| | |
|
|/ |
|
| |
|
|
|
|
| |
is disabled. Patch by Petr Viktorin.
|
|\
| |
| |
| |
| | |
PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
to check for and handle errors correctly.
|
| |
| |
| |
| |
| | |
PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
to check for and handle errors correctly.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
|\ \
| |/ |
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|