I'm having difficulty catching dbi.program-error which occurs this way:
import dbi, odbc
[...]
self.__cur.exec ute(sql)
[color=blue][color=green][color=darkred]
>>> dbi.program-error: [Sybase][ODBC Driver][Adaptive Server Anywhere]Table 'depfile' not found in EXEC[/color][/color][/color]
but
try:
self.__cur.exec ute(sql)
except dbi.program-error,e:
print " caught "
raise
causes
[color=blue][color=green][color=darkred]
>>> except dbi.program-error, e:
>>> AttributeError: 'module' object has no attribute 'program'[/color][/color][/color]
What, in general, is the offender here? The hyphen in
"dbi.progra m-error" or the dot?
import dbi, odbc
[...]
self.__cur.exec ute(sql)
[color=blue][color=green][color=darkred]
>>> dbi.program-error: [Sybase][ODBC Driver][Adaptive Server Anywhere]Table 'depfile' not found in EXEC[/color][/color][/color]
but
try:
self.__cur.exec ute(sql)
except dbi.program-error,e:
print " caught "
raise
causes
[color=blue][color=green][color=darkred]
>>> except dbi.program-error, e:
>>> AttributeError: 'module' object has no attribute 'program'[/color][/color][/color]
What, in general, is the offender here? The hyphen in
"dbi.progra m-error" or the dot?
Comment