Want to catch pywintypes.api_error

David Bolen db3l at fitlinxx.com
Wed Mar 14 02:52:24 CET 2001


"Franz GEIGER" <fgeiger at datec.at> writes:

> How could I have figured out this by myself? I did a text search for
> api_error over my ActivePython distribution, w/o success. Is it burrie din
> those pyd-files?

I'm not sure if it's explicitly documented, but one good way is to do
a dir() of the module at hand - you'll find an "error" object in both
pywintypes and the individual modules such as win32api.

It is a bit confusing that the internal class is called api_error (and
that's how the instance objects display themselves) but the actual
instance is called error.  But having an "error" object in a module
for exceptions is reasonably common, so a good thing to check for.

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list