[python-win32] odbc exceptions

Robin Becker robin at reportlab.com
Tue Nov 30 16:28:44 CET 2010


I don't know if the odbc module is deprecated, but I'm seeing this strangeness

C:\code\rlextra\examples\graphics>cat toad.py
try:
     import odbc
     print odbc.__file__
     conn = odbc.odbc('not_a_db_path')
except:
     raise

C:\code\rlextra\examples\graphics>toad.py
C:\Python26\lib\site-packages\win32\odbc.pyd
Traceback (most recent call last):
   File "C:\code\rlextra\examples\graphics\toad.py", line 6, in <module>
     raise
TypeError: exceptions must be classes or instances, not str

C:\code\rlextra\examples\graphics>

so I guess odbc must be raising a string exception
-- 
Robin Becker


More information about the python-win32 mailing list