summaryrefslogtreecommitdiffstats
path: root/Include/pyerrors.h
Commit message (Collapse)AuthorAgeFilesLines
* Patch by Tim Peters:Guido van Rossum1999-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new builtin exception, UnboundLocalError, raised when ceval.c tries to retrieve or delete a local name that isn't bound to a value. Currently raises NameError, which makes this behavior a FAQ since the same error is raised for "missing" global names too: when the user has a global of the same name as the unbound local, NameError makes no sense to them. Even in the absence of shadowing, knowing whether a bogus name is local or global is a real aid to quick understanding. Example: D:\src\PCbuild>type local.py x = 42 def f(): print x x = 13 return x f() D:\src\PCbuild>python local.py Traceback (innermost last): File "local.py", line 8, in ? f() File "local.py", line 4, in f print x UnboundLocalError: x D:\src\PCbuild> Note that UnboundLocalError is a subclass of NameError, for compatibility with existing class-exception code that may be trying to catch this as a NameError. Unfortunately, I see no way to make this wholly compatible with -X (see comments in bltinmodule.c): under -X, [UnboundLocalError is an alias for NameError --GvR]. [The ceval.c patch differs slightly from the second version that Tim submitted; I decided not to raise UnboundLocalError for DELETE_NAME, only for DELETE_LOCAL. DELETE_NAME is only generated at the module level, and since at that level a NameError is raised for referencing an undefined name, it should also be raised for deleting one.]
* Add DL_IMPORT(returntype) for all officially exported functions.Guido van Rossum1998-12-041-19/+19
|
* Added PyExc_NotImplementedErrorBarry Warsaw1998-12-011-0/+1
|
* New global variables: PyExc_EnvironmentError and PyExc_OSErrorBarry Warsaw1998-07-231-0/+3
| | | | New function: PyErr_SetFromErrnoWithFilename(PyObject* char*)
* New API PyErr_NewException(name, base, dict) to create simple new exceptions.Guido van Rossum1997-09-161-0/+4
|
* [Py_Exc]NumberError => [Py_Exc]ArithmeticErrorBarry Warsaw1997-09-161-1/+1
|
* Introduce PyExc_Exception as the conceptual root class for all exceptions.Guido van Rossum1997-09-161-0/+1
|
* Added externs for three new exceptions PyExc_StandardError,Barry Warsaw1997-08-291-1/+7
| | | | | | | PyExc_NumberError, and PyExc_LookupError. Also added extern for pre-instantiated exception instance PyExc_MemoryErrorInst. Removed extern of obsolete exception PyExc_AccessError.
* Three new C API functions:Barry Warsaw1997-08-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | - int PyErr_GivenExceptionMatches(obj1, obj2) Returns 1 if obj1 and obj2 are the same object, or if obj1 is an instance of type obj2, or of a class derived from obj2 - int PyErr_ExceptionMatches(obj) Higher level wrapper around PyErr_GivenExceptionMatches() which uses PyErr_Occurred() as obj1. This will be the more commonly called function. - void PyErr_NormalizeException(typeptr, valptr, tbptr) Normalizes exceptions, and places the normalized values in the arguments. If type is not a class, this does nothing. If type is a class, then it makes sure that value is an instance of the class by: 1. if instance is of the type, or a class derived from type, it does nothing. 2. otherwise it instantiates the class, using the value as an argument. If value is None, it uses an empty arg tuple, and if the value is a tuple, it uses just that.
* Added AssertionError.Guido van Rossum1997-04-021-0/+1
|
* Remove ConflictError (which was also removed from bltinmodule.c, evenGuido van Rossum1997-03-311-1/+0
| | | | though the checkin message failed to note that).
* Changes for Lee Busby's SIGFPE patch set.Guido van Rossum1997-02-141-0/+1
| | | | New file pyfpe.h, new exception FloatingPointError.
* Added prototype for PyErr_Format(exception, formatstring, ...) -> NULL.Guido van Rossum1997-02-141-0/+1
|
* Added declaration for PyErr_SetInterrupt.Barry Warsaw1997-01-031-1/+4
|
* Add const to error and newstring functionsGuido van Rossum1996-12-101-1/+1
|
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-12/+19
|
* make the type a parameter of the DL_IMPORT macro, for Borland CGuido van Rossum1995-02-271-19/+19
|
* new names for lots of new functionsGuido van Rossum1995-01-171-1/+1
|
* The great renaming, phase two: all header files have been updated toGuido van Rossum1995-01-121-33/+31
| | | | | | | use the new names exclusively, and the linker will see the new names. Files that import "Python.h" also only see the new names. Files that import "allobjects.h" will continue to be able to use the old names, due to the inclusion (in allobjects.h) of "rename2.h".
* Added 1995 copyright.Guido van Rossum1995-01-041-2/+2
| | | | | | object.h: made sizes and refcnts signed ints. stringobject.h: make getstrsize() signed int. methodobject.h: add METH_VARARGS and METH_FREENAME flag bit definitions.
* Lots of small things, see ChangeLogGuido van Rossum1994-12-301-1/+2
|
* Changes for dynamic linking under NTGuido van Rossum1994-08-181-19/+19
|
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-3/+4
|
* * Added support for X11 modules.Guido van Rossum1993-07-281-0/+11
| | | | | | | * Makefile: change location of FORMS library. * posixmodule.c: turn #if 0 into #ifdef MSDOS (stuff in unistd.h or not) * Almost all .h files: added CPP magic to avoid duplicate inclusions and to support inclusion from C++.
* Several changes in one:Guido van Rossum1993-05-191-0/+4
| | | | | | | | | | | | | | | | (1) dictionaries/mappings now have attributes values() and items() as well as keys(); at the C level, use the new function mappinggetnext() to iterate over a dictionary. (2) "class C(): ..." is now illegal; you must write "class C: ...". (3) Class objects now know their own name (finally!); and minor improvements to the way how classes, functions and methods are represented as strings. (4) Added an "access" statement and semantics. (This is still experimental -- as long as you don't use the keyword 'access' nothing should be changed.)
* * Changed all copyright messages to include 1993.Guido van Rossum1993-03-291-2/+2
| | | | | | | | | | | | | | | | | * Stubs for faster implementation of local variables (not yet finished) * Added function name to code object. Print it for code and function objects. THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version number has changed accordingly) * Print address of self for built-in methods * New internal functions getattro and setattro (getattr/setattr with string object arg) * Replaced "dictobject" with more powerful "mappingobject" * New per-type functio tp_hash to implement arbitrary object hashing, and hashobject() to interface to it * Added built-in functions hash(v) and hasattr(v, 'name') * classobject: made some functions static that accidentally weren't; added __hash__ special instance method to implement hash() * Added proper comparison for built-in methods and functions
* Copyright for 1992 addedGuido van Rossum1992-04-051-1/+1
|
* Added SystemExit.Guido van Rossum1991-12-311-0/+1
|
* Added ImportError.Guido van Rossum1991-12-241-0/+1
|
* Regularize exceptions.Guido van Rossum1991-12-161-11/+9
|
* SyntaxError.Guido van Rossum1991-12-161-0/+1
|
* New exceptions.Guido van Rossum1991-12-101-6/+8
|
* Added copyright notice.Guido van Rossum1991-02-191-0/+24
|
* "Compiling" versionGuido van Rossum1990-12-201-1/+2
|
* Added err_badcall() and planned new errors.Guido van Rossum1990-10-211-0/+9
|
* Made exception objects extern.Guido van Rossum1990-10-141-7/+14
| | | | Added convenience functions.
* Initial revisionGuido van Rossum1990-10-141-0/+17