summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-35504: Fix a SystemError when delete the characters_written attribute of ↵Serhiy Storchaka2018-12-171-0/+8
| | | | an OSError. (GH-11172)
* bpo-33029: Fix signatures of getter and setter functions. (GH-10746)Serhiy Storchaka2018-11-271-13/+17
| | | Fix also return type for few other functions (clear, releasebuffer).
* bpo-35081: Add Include/internal/pycore_object.h (GH-10640)Victor Stinner2018-11-211-0/+1
| | | | Move _PyObject_GC_TRACK() and _PyObject_GC_UNTRACK() from Include/objimpl.h to Include/internal/pycore_object.h.
* bpo-35081: Rename internal headers (GH-10275)Victor Stinner2018-11-121-2/+2
| | | | | | | | | | | | | | 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
* bpo-35081: Add pycore_ prefix to internal header files (GH-10263)Victor Stinner2018-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | * 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".
* bpo-34940: Fix the error handling in _check_for_legacy_statements(). (GH-9764)Zackery Spytz2018-10-121-8/+18
|
* bpo-33818: PyExceptionClass_Name() will now return "const char *". (GH-7581)Serhiy Storchaka2018-06-151-2/+2
|
* Clean up after bpo-33738. (GH-7627)Serhiy Storchaka2018-06-111-1/+1
| | | | | * Add declarations even if they are overridden by macros. * Make the declaration and the definition of PyExceptionClass_Name consistent.
* bpo-33738: Address review comments in GH #7477 (GH-7585)Christian Tismer2018-06-101-0/+1
|
* bpo-33738: Fix macros which contradict PEP 384 (GH-7477)Christian Tismer2018-06-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During development of the limited API support for PySide, we saw an error in a macro that accessed a type field. This patch fixes the 7 errors in the Python headers. Macros which were not written as capitals were implemented as function. To do the necessary analysis again, a script was included that parses all headers and looks for "->tp_" in serctions which can be reached with active limited API. It is easily possible to call this script as a test. Error listing: ../../Include/objimpl.h:243 #define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \ (Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o))) Action: commented only ../../Include/objimpl.h:362 #define PyType_SUPPORTS_WEAKREFS(t) ((t)->tp_weaklistoffset > 0) Action: commented only ../../Include/objimpl.h:364 #define PyObject_GET_WEAKREFS_LISTPTR(o) \ ((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset)) Action: commented only ../../Include/pyerrors.h:143 #define PyExceptionClass_Name(x) \ ((char *)(((PyTypeObject*)(x))->tp_name)) Action: implemented function ../../Include/abstract.h:593 #define PyIter_Check(obj) \ ((obj)->ob_type->tp_iternext != NULL && \ (obj)->ob_type->tp_iternext != &_PyObject_NextNotImplemented) Action: implemented function ../../Include/abstract.h:713 #define PyIndex_Check(obj) \ ((obj)->ob_type->tp_as_number != NULL && \ (obj)->ob_type->tp_as_number->nb_index != NULL) Action: implemented function ../../Include/abstract.h:924 #define PySequence_ITEM(o, i)\ ( Py_TYPE(o)->tp_as_sequence->sq_item(o, i) ) Action: commented only
* bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. ↵Siddhesh Poyarekar2018-04-291-3/+3
| | | | | | | | | (GH-6030) METH_NOARGS functions need only a single argument but they are cast into a PyCFunction, which takes two arguments. This triggers an invalid function cast warning in gcc8 due to the argument mismatch. Fix this by adding a dummy unused argument.
* bpo-32685: Improve suggestion for print statement (GH-5375)Nitish Chandra2018-01-281-14/+19
| | | | | | | Better account for single-line compound statements and semi-colon separated statements when suggesting Py3 replacements for Py2 print statements. Initial patch by Nitish Chandra.
* bpo-32028: Fix suggestions for indented print statements (GH-4688)Sanyam Khurana2018-01-201-5/+11
| | | | | | | The suggested replacement for print statements previously failed to account for leading whitespace and hence could end up including unwanted text in the proposed call to the print builtin. Patch by Sanyam Khurana.
* bpo-30399: Get rid of trailing comma in the repr of BaseException. (#1650)Serhiy Storchaka2017-11-151-1/+5
|
* bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327)xdegaye2017-10-261-32/+0
|
* bpo-31497: Add private helper _PyType_Name(). (#3630)Serhiy Storchaka2017-09-171-7/+1
| | | | This function returns the last component of tp_name after a dot. Returns tp_name itself if it doesn't contain a dot.
* bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow2017-09-081-0/+2
| | | | | | | * 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).
* bpo-31161: only check for parens error for SyntaxError (#3082)Martijn Pieters2017-08-221-5/+10
| | | | Subclasses such as IndentError and TabError should not have this message applied.
* bpo-30597: Show expected input in custom 'print' error message. (#2009)Sanyam Khurana2017-06-201-3/+45
|
* bpo-30061: Check if PyObject_Size()/PySequence_Size()/PyMapping_Size() (#1096)Serhiy Storchaka2017-04-191-1/+1
| | | | | | raised an error. Replace them with using concrete types API that never fails if appropriate.
* bpo-29998: Pickling and copying ImportError now preserves name and path (#1010)Serhiy Storchaka2017-04-081-0/+48
| | | attributes.
* bpo-29927: Remove duplicate BufferError init and unnecessary semicolons (GH-866)Louie Lu2017-03-291-53/+51
|
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-4/+2
| | | | possible. Patch is writen with Coccinelle.
* Issue #28511: Use the "U" format instead of "O!" in PyArg_Parse*.Serhiy Storchaka2016-10-231-23/+10
|
* Issue #28289: ImportError.__init__ now resets not specified attributes.Serhiy Storchaka2016-09-281-9/+7
|
* Issue #21578: Fixed misleading error message when ImportError called withSerhiy Storchaka2016-09-271-22/+24
|\ | | | | | | invalid keyword args.
| * Issue #21578: Fixed misleading error message when ImportError called withSerhiy Storchaka2016-09-271-22/+24
| | | | | | | | invalid keyword args.
* | Issue #15767: Add ModuleNotFoundError.Eric Snow2016-09-071-0/+9
| |
* | MergeRaymond Hettinger2016-08-261-1/+1
|\ \ | |/
| * Issue 19504: Change "customise" to "customize" American spelling.Raymond Hettinger2016-08-261-1/+1
| |
* | Issue #27692: Removed unnecessary NULL checks in exceptions.c.Serhiy Storchaka2016-08-201-4/+3
| | | | | | | | Patch by Xiang Zhang.
* | Issue #27652: Expose ESHUTDOWN conditionallyBerker Peksag2016-07-301-0/+2
| | | | | | | | | | | | ESHUTDOWN is also exposed conditionally in Modules/errnomodule.c. Patch by Ed Schouten.
* | Issue #27626: Merge spelling fixes from 3.5Martin Panter2016-07-281-3/+3
|\ \ | |/
| * Issue #27626: Spelling fixes in docs, comments and internal namesMartin Panter2016-07-281-3/+3
| | | | | | | | Based on patch by Ville Skyttä.
* | Issue #27171: Merge typo fixes from 3.5Martin Panter2016-06-021-1/+1
|\ \ | |/
| * Issue #27171: Fix typos in documentation, comments, and test function namesMartin Panter2016-06-021-1/+1
| |
* | Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-19/+19
|\ \ | |/
| * Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-16/+16
| |
* | Issue #20440: Cleaning up the code by using Py_SETREF.Serhiy Storchaka2016-01-051-14/+8
|/
* Issue #20440: More use of Py_SETREF.Serhiy Storchaka2015-12-271-9/+10
| | | | | This patch is manually crafted and contains changes that couldn't be handled automatically.
* Issue #20440: Applied yet one patch for using Py_SETREF.Serhiy Storchaka2015-12-271-32/+20
| | | | The patch is automatically generated, it replaces the code that uses Py_CLEAR.
* Issue #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka2015-12-241-2/+1
| | | | macro Py_SETREF.
* Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5Martin Panter2015-11-021-1/+1
|\
| * Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-021-1/+1
| | | | | | | | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed or edited some other way to fix the grammar.
* | Issue #19235: Add new RecursionError exception. Patch by Georg Brandl.Yury Selivanov2015-07-031-6/+13
| |
* | PEP 0492 -- Coroutines with async and await syntax. Issue #24017.Yury Selivanov2015-05-121-0/+9
| |
* | Issue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer()Serhiy Storchaka2015-02-021-13/+17
|\ \ | |/ | | | | and PyObject_AsWriteBuffer().
| * Issue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer()Serhiy Storchaka2015-02-021-13/+17
| | | | | | | | and PyObject_AsWriteBuffer().
* | Issue #22156: Fix "comparison between signed and unsigned integers" compilerVictor Stinner2014-08-151-1/+1
|/ | | | | | | warnings in the Objects/ subdirectory. PyType_FromSpecWithBases() and PyType_FromSpec() now reject explicitly negative slot identifiers.
* Issue #21669: Special case print & exec syntax errorsNick Coghlan2014-06-161-0/+135
|