Hi Titus,
we already try to handle these types of errors, specifically for gdbm
(here is our current dbfile.py code). Based on what you said, it
sounds like dbm.dbm manages to come up with yet another incompatible
iteration method. It shouldn't be hard to add support for that.
try:
return iter(self.dict) # <---------- LINE 104
except TypeError: # gdbm lacks __iter__ method, so try
iter_gdbm()
exc_type, exc_value, exc_traceback = sys.exc_info()
try:
self.dict.firstkey
except AttributeError: # evidently not a gdbm dict
raise exc_value, None, exc_traceback # re-raise
original error
else: # iterate using gdbm-specific method
return iter_gdbm(self.dict)
-- Chris
On Aug 5, 2009, at 9:05 AM, C. Titus Brown wrote:
> on my laptop, I don't have the bsddb module installed for python2.6,
> and
> so I get this warning,
> File "/Users/t/dev/pygr/pygr/dbfile.py", line 104, in __iter__
> return iter(self.dict)
> TypeError: 'dbm.dbm' object is not iterable
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pygr-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pygr-dev?hl=en
-~----------~----~----~----~------~----~------~--~---