| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Replace global configuration variables with core_config read from the
current interpreter.
Cleanup dynload_hpux.c.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename Include/internal/ headers:
* pycore_hash.h -> pycore_pyhash.h
* pycore_lifecycle.h -> pycore_pylifecycle.h
* pycore_mem.h -> pycore_pymem.h
* pycore_state.h -> pycore_pystate.h
Add missing headers to Makefile.pre.in and PCbuild:
* pycore_condvar.h.
* pycore_hamt.h
* pycore_pyhash.h
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Rename Include/internal/ header files:
* pyatomic.h -> pycore_atomic.h
* ceval.h -> pycore_ceval.h
* condvar.h -> pycore_condvar.h
* context.h -> pycore_context.h
* pygetopt.h -> pycore_getopt.h
* gil.h -> pycore_gil.h
* hamt.h -> pycore_hamt.h
* hash.h -> pycore_hash.h
* mem.h -> pycore_mem.h
* pystate.h -> pycore_state.h
* warnings.h -> pycore_warnings.h
* PCbuild project, Makefile.pre.in, Modules/Setup: add the
Include/internal/ directory to the search paths of header files.
* Update includes. For example, replace #include "internal/mem.h"
with #include "pycore_mem.h".
|
|
|
|
| |
(GH-6398)
|
|
|
|
| |
Many type object initializations labeled a field "tp_size" in the
comment, but the name of that field is tp_basicsize.
|
|
|
|
| |
sys_setcheckinterval() now uses a local variable to parse arguments,
before writing into interp->check_interval.
|
|
|
|
| |
They where silenced before.
|
|
|
|
|
| |
Multi-phase initialized modules allow m_traverse to be called while the
module is still being initialized, so module authors may need to account
for that.
|
|
|
|
|
| |
Implement PEP 562: module __getattr__ and __dir__.
The implementation simply updates module_getattro and
module_dir.
|
|
|
|
| |
attribute. (#3620)
|
|
|
|
|
| |
A bunch of code currently uses PyInterpreterState.modules directly instead of PyImport_GetModuleDict(). This complicates efforts to make changes relative to sys.modules. This patch switches to using PyImport_GetModuleDict() uniformly. Also, a number of related uses of sys.modules are updated for uniformity for the same reason.
Note that this code was already reviewed and merged as part of #1638. I reverted that and am now splitting it up into more focused parts.
|
|
|
| |
PR #1638, for bpo-28411, causes problems in some (very) edge cases. Until that gets sorted out, we're reverting the merge. PR #3506, a fix on top of #1638, is also getting reverted.
|
|
|
|
|
|
|
| |
* group the (stateful) runtime globals into various topical structs
* consolidate the topical structs under a single top-level _PyRuntimeState struct
* add a check-c-globals.py script that helps identify runtime globals
Other globals are excluded (see globals.txt and check-c-globals.py).
|
|
|
| |
sys.modules is the one true source.
|
| |
|
|
|
|
| |
rather of "char *".
|
|
|
|
| |
UTF-8 represenatation of Unicode objects.
|
|
|
|
| |
with PyUnicode_AsUTF8 and PyUnicode_AsUTF8AndSize.
|
|\
| |
| |
| |
| |
| | |
_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.
|
| |
| |
| |
| | |
Patch by Xiang Zhang.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Multi-phase extension module import now correctly allows the
``m_methods`` field to be used to add module level functions
to instances of non-module types returned from ``Py_create_mod``.
Patch by Xiang Zhang.
|
|/
|
|
|
|
| |
PyModule_NewObject already sets md_dict to PyDict_New():
m->md_dict = PyDict_New();
|
| |
|
|
|
|
| |
macro Py_SETREF.
|
|
|
|
|
|
|
|
| |
- missing DECREF in PyModule_FromDefAndSpec2
- missing DECREF in PyType_FromSpecAndBases2
- missing DECREF in _testmultiphase module
Patch by Petr Viktorin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
message.
|
|\
| |
| |
| | |
This silences a Coverity complain.
|
| |
| |
| |
| | |
This silences a Coverity complain.
|
| |
| |
| |
| | |
cleaning other modules. The sys and builtins modules are cleaned last.
|
| | |
|
| |
| |
| |
| | |
globals to None, in most cases.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
attributes to None.
The long-term goal is for people to be able to rely on these
attributes existing and checking for None to see if they have been
set. Since import itself sets these attributes when a loader does not
the only instances when the attributes are None are from someone
overloading __import__() and not using a loader or someone creating a
module from scratch.
This patch also unifies module initialization. Before you could have
different attributes with default values depending on how the module
object was created. Now the only way to not get the same default set
of attributes is to circumvent initialization by calling
ModuleType.__new__() directly.
|
|\
| |
| |
| | |
Patch by Julia Lawall.
|
| |
| |
| |
| | |
Patch by Julia Lawall.
|
| | |
|
| |
| |
| |
| | |
Thanks to Eric Snow for the patch.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
repr(module) uses %R to format module name and filenames, instead of '%s' and
'%U', so surrogates from undecodable bytes in a filename (PEP 383) are escaped.
|