[Python-Dev] win32 specific exception in the core?
Fredrik Lundh
fredrik@pythonware.com
Mon, 7 Feb 2000 09:25:13 +0100
Mark Hammond <mhammond@skippinet.com.au> wrote:
> As part of the registry work, Im toying with the idea of a standard =
"win32
> exception" error in the Python core.
>=20
> The reasons why I think a standard exception would be useful are:
>=20
> * Single body of code that knows how to raise these exceptions. Eg,
> whenever an extension module needs to report that a Win32 API function
> failed, they can use the core routines to create the exception object =
- just
> like they can with OSError. This ensures consistency, and saves each
> extension module author from reinventing the wheel.
>=20
> * No confusion about what exception Python programmers should catch. =
In the
> same way that "OSError" will be thrown any time the C runtime library =
fails,
> the "Win32Error" exception will be thrown whenever a Win32 API =
function
> (called directly) fails.
any reason you can't just throw OSError exceptions?
(after all, Windows is an operating system, right? ;-)
</F>