| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
(cherry picked from commit a2eefa67542c25617a58c03a27c17fd48e2a0856)
Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
|
|
|
|
|
| |
(#4135)
(cherry picked from commit 56d1f5ca32892c7643eb8cee49c40c1644f1abfe)
|
|
|
|
|
| |
of an exception with a bad __module__ attribute. (GH-3539) (#3556)
(cherry picked from commit f6e61df01536493f1280cd07639c7ff9bffb2cdc)
|
|\ |
|
| |
| |
| |
| | |
Based on patch by Michael Layzell.
|
|\ \
| |/
| |
| | |
PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
|
| |
| |
| |
| | |
PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
|
|\ \
| |/
| |
| |
| |
| | |
The latter function is more readable, faster and doesn't raise exceptions.
Based on patch by Xiang Zhang.
|
| |
| |
| |
| |
| |
| | |
The latter function is more readable, faster and doesn't raise exceptions.
Based on patch by Xiang Zhang.
|
| |
| |
| |
| |
| |
| |
| |
| | |
new exception with setting current exception as __cause__.
_PyErr_FormatFromCause(exception, format, args...) is equivalent to Python
raise exception(format % args) from sys.exc_info()[1]
|
|\ \
| |/
| |
| | |
_PyErr_ChainExceptions().
|
| |
| |
| |
| | |
_PyErr_ChainExceptions().
|
| | |
|
| | |
|
|/
|
|
|
| |
Issue #27809: Helper function optimized to create an exception: use fastcall
whenever possible.
|
|
|
|
| |
Patch by Ofer Schwarz.
|
|
|
|
| |
in places where Py_DECREF was used.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue #26154: Add a new private _PyThreadState_UncheckedGet() function which
gets the current thread state, but don't call Py_FatalError() if it is NULL.
Python 3.5.1 removed the _PyThreadState_Current symbol from the Python C API to
no more expose complex and private atomic types. Atomic types depends on the
compiler or can even depend on compiler options. The new function
_PyThreadState_UncheckedGet() allows to get the variable value without having
to care of the exact implementation of atomic types.
Changes:
* Replace direct usage of the _PyThreadState_Current variable with a call to
_PyThreadState_UncheckedGet().
* In pystate.c, replace direct usage of the _PyThreadState_Current variable
with the PyThreadState_GET() macro for readability.
* Document also PyThreadState_Get() in pystate.h
|
|
|
|
|
| |
This patch is manually crafted and contains changes that couldn't be handled
automatically.
|
| |
|
|\
| |
| |
| | |
Patch by Martin Panter.
|
| |
| |
| |
| | |
Patch by Martin Panter.
|
| |
| |
| |
| |
| | |
current exception because they can run arbitrary Python code and so no
exception must be set.
|
| |
| |
| |
| |
| | |
* If fopen() fails, OSError is raised with the original filename object.
* The GIL is now released while calling fopen()
|
|\ \
| |/
| |
| | |
_PyErr_ChainExceptions() function.
|
| |
| |
| |
| | |
_PyErr_ChainExceptions() function.
|
|/
|
|
| |
but accepting a `va_list` argument.
|
| |
|
|
|
|
|
|
| |
now register both filenames in the exception on failure.
This required adding new C API functions allowing OSError exceptions
to reference two filenames instead of one.
|
|
|
|
|
|
|
| |
are used.
Move also _Py_IDENTIFIER() defintions to the top in modified files to remove
identifiers duplicated in the same file.
|
|
|
|
|
|
|
| |
_PyUnicode_CompareWithId() is faster than PyUnicode_CompareWithASCIIString()
when both strings are equal and interned.
Add also _PyId_builtins identifier for "builtins" common 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.
|
| |
|
| |
|
|
|
|
|
| |
are now created non-inheritable; add functions os.get/set_inheritable(),
os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
|
|
|
|
| |
filenames anymore on Windows.
|
|
|
|
|
|
|
|
| |
* Catch PyFile_WriteString() and PyFile_WriteObject() errors
* Clear the current exception on _PyObject_GetAttrId() failure
* Use PyUnicode_CompareWithASCIIString() and PyFile_WriteObject() instead of
_PyUnicode_AsString() and strcmp() to avoid Unicode encoding error. stderr
has a more tolerant error handler than utf-8/strict.
|
|
|
|
| |
before PyExc_MemoryError has been initialized by _PyExc_Init()
|
|
|
|
|
|
|
|
|
|
|
|
| |
with an assertion error if they are called with an exception set
(PyErr_Occurred()).
If these functions are called with an exception set, the exception may be
cleared and so the caller looses its exception.
Add also assertions to PyEval_CallObjectWithKeywords() and call_function() to
check if the function succeed with no exception set, or the function failed
with an exception set.
|
| |
|
|
|
|
|
|
| |
failure
PyObject_IsSubclass() can fail and raise a new exception!
|
|
|
|
| |
fails with an assertion error
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Forgot to raise ModuleNotFoundError when None is found in sys.modules.
This led to introducing the C function PyErr_SetImportErrorSubclass()
to make setting ModuleNotFoundError easier.
Also updated the reference docs to mention ModuleNotFoundError
appropriately. Updated the docs for ModuleNotFoundError to mention the
None in sys.modules case.
Lastly, it was noticed that PyErr_SetImportError() was not setting an
exception when returning None in one case. That issue is now fixed.
|
|
|
|
| |
Patch by Serhiy Storchaka.
|
|
|
|
| |
Patch by Alon Horev with update by Alexey Kachayev.
|
|
|
|
| |
Patch by Stefan Behnel.
|
| |
|