| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
are used.
Move also _Py_IDENTIFIER() defintions to the top in modified files to remove
identifiers duplicated in the same file.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Use aslo PyUnicode_FromFormat() to format the line so only one call to
PyFile_WriteObject() is needed. tb_displayline() of Python/traceback.c has
similar implementation.
|
| | |
| | |
| | |
| | | |
The comment is meaningless since changeset 4e985a96a612.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
_PyUnicode_CompareWithId() is faster than PyUnicode_CompareWithASCIIString()
when both strings are equal and interned.
Add also _PyId_builtins identifier for "builtins" common string.
|
| | |
| | |
| | |
| | | |
Replace _PyUnicode_AsString()+strcmp() with PyUnicode_CompareWithASCIIString().
|
| | |
| | |
| | |
| | | |
string "flush" to call the flush method
|
| | |
| | |
| | |
| | | |
"metaclass" string
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
instead of creating temporary Unicode string objects
Add also more identifiers in pythonrun.c to avoid temporary Unicode string
objets for the interactive interpreter.
|
| | |
| | |
| | |
| | | |
to only create the "displayhook" string once
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Only decode the filename once. PyRun_InteractiveOneObject() uses an identifier
for "<string>" string, so the byte string is only decoded once.
|
| | |
| | |
| | |
| | | |
key from sys._xoptions
|
| | |
| | |
| | |
| | |
| | |
| | | |
dictionary key and only decodes "\n" string once to write a newline.
So "builtins" and "\n" are only decoded once from UTF-8, at the first call.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
importlib.machinery.FileFinder.
While originally moved to stop special-casing '' as PathFinder farther
up the typical call chain now uses the cwd in the instance of '', it
was deemed an unnecessary risk to breaking subclasses of FileFinder to
take the special-casing out.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
shutdown
After more tests, I now think that it is the safest option.
|
| | | |
|
| | |
| | |
| | |
| | | |
for TYPE_DICT and stop immedialty on first r_object() failure
|
| | |
| | |
| | |
| | | |
TYPE_SMALL_TUPLE
|
| | |
| | |
| | |
| | | |
failure, don't read any more data
|
| | |
| | |
| | |
| | | |
call a Python function with an exception set
|
| | |
| | |
| | |
| | | |
with an exception set
|
|\ \ \
| |/ / |
|
| | | |
|
|\ \ \
| |/ / |
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Warnings may be emitted during Python shutdown, like "unclosed file XXX".
During shutdown, globals()['__main__'] may be None.
|
| | |
| | |
| | |
| | | |
characters.
|
| | |
| | |
| | |
| | |
| | | |
exceptions when merging fast locals into f_locals of a frame.
PyEval_GetLocals() now raises an exception and return NULL on failure.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
finalization.
sys.argv is set to None during Python finalization: add PyList_Check() to avoid
a crash in PyList_Size().
|
| | | |
|
|\ \ \
| |/ /
| | |
| | | |
Python executable and not removed by the linker's optimizer.
|
| | |
| | |
| | |
| | | |
Python executable and not removed by the linker's optimizer.
|
| | |
| | |
| | |
| | | |
upside down.
|
| | | |
|
| | |
| | |
| | |
| | | |
Eliminates a refleak introduced in commit b4a325275fb0
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
#19301)
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
exists when checking for a package.
Before there was an isdir check and then various isfile checks for
possible __init__ files when looking for a package.
This change drops the isdir check by leaning
on the assumption that a directory will not contain something named
after the module being imported which is not a directory. If the module
is a package then it saves a stat call. If there is nothing in the
directory with the potential package name it also saves a stat call.
Only if there is something in the directory named the same thing as
the potential package will the number of stat calls increase
(due to more wasteful __init__ checks).
Semantically there is no change as the isdir check moved
down so that namespace packages continue to have no chance of
accidentally collecting non-existent directories.
|
| | |
| | |
| | |
| | | |
now that self.path is no longer forced to '.'.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
and stop importlib.machinery.FileFinder treating '' as '.'.
Previous PathFinder transformed '' into '.' which led to __file__ for
modules imported from the cwd to always be relative paths. This meant
the values of the attribute were wrong as soon as the cwd changed.
This change now means that as long as the site module is run (which
makes all entries in sys.path absolute) then all values for __file__
will also be absolute unless it's for __main__ when specified by file
path in a relative way (modules imported by runpy will have an
absolute path).
Now that PathFinder is no longer treating '' as '.' it only makes
sense for FileFinder to stop doing so as well. Now no transformation
is performed for the directory given to the __init__ method.
Thanks to Madison May for the initial patch.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- don't call PyErr_NoMemory with interpreter is not initialised
- note that it's OK to call _PyMem_RawStrDup here
- don't include this in the limited API
- capitalise "IO"
- be explicit that a non-zero return indicates an error
- include versionadded marker in docs
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This new pre-initialization API allows embedding
applications like Blender to force a particular
encoding and error handler for the standard IO streams.
Also refactors Modules/_testembed.c to let us start
testing multiple embedding scenarios.
(Initial patch by Bastien Montagne)
|
| | | |
|