Error type for shelve.open()

aomighty at gmail.com aomighty at gmail.com
Wed Jul 5 18:44:30 EDT 2006


I wanted to write the following code:

import shelve
try:
   db = shelve.open(file, "r")
except SomeError:
   print "Oh no, db not found"

Only, I'm not sure what SomeError should be. I tried error,
anydbm.error, shelve.open.anydb.error, etc. but can't find it. Things
worked fine with simply except:, but that's not optimal.

Does anyone know either the what the error is or where I can find it
for certain?

Thanks,
Martin




More information about the Python-list mailing list