Vous devez avoir un compte Developpez.com et être connecté pour pouvoir participer aux discussions.

Identifiez-vous
Identifiant
Mot de passe
Mot de passe oublié ?
Créer un compte

Vous n'avez pas encore de compte Developpez.com ? L'inscription est gratuite et ne vous prendra que quelques instants !

Je m'inscris !

Developpez.com

Python

Choisissez la catégorie, puis la rubrique :

4.1 Standard Exceptions


4.1 Standard Exceptions

All standard Python exceptions are available as global variables whose names are "PyExc_" followed by the Python exception name. These have the type PyObject*; they are all class objects. For completeness, here are all the variables:

C Name Python Name Notes
PyExc_BaseException BaseException (1), (4)
PyExc_Exception Exception (1)
PyExc_StandardError StandardError (1)
PyExc_ArithmeticError ArithmeticError (1)
PyExc_LookupError LookupError (1)
PyExc_AssertionError AssertionError
PyExc_AttributeError AttributeError
PyExc_EOFError EOFError
PyExc_EnvironmentError EnvironmentError (1)
PyExc_FloatingPointError FloatingPointError
PyExc_IOError IOError
PyExc_ImportError ImportError
PyExc_IndexError IndexError
PyExc_KeyError KeyError
PyExc_KeyboardInterrupt KeyboardInterrupt
PyExc_MemoryError MemoryError
PyExc_NameError NameError
PyExc_NotImplementedError NotImplementedError
PyExc_OSError OSError
PyExc_OverflowError OverflowError
PyExc_ReferenceError ReferenceError (2)
PyExc_RuntimeError RuntimeError
PyExc_SyntaxError SyntaxError
PyExc_SystemError SystemError
PyExc_SystemExit SystemExit
PyExc_TypeError TypeError
PyExc_ValueError ValueError
PyExc_WindowsError WindowsError (3)
PyExc_ZeroDivisionError ZeroDivisionError

Notes:

(1)
This is a base class for other standard exceptions.

(2)
This is the same as weakref.ReferenceError.

(3)
Only defined on Windows; protect code that uses this by testing that the preprocessor macro MS_WINDOWS is defined.

(4)
New in version 2.5.

See About this document... for information on suggesting changes.
Contacter le responsable de la rubrique Python

Partenaire : Hébergement Web