Changeset 1875:6d87bc9aaf5a in orange-bioinformatics for orangecontrib/bio/obiKEGG/caching.py


Ignore:
Timestamp:
10/08/13 14:53:14 (7 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Cache entry should be invalid if unpickling raises an error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orangecontrib/bio/obiKEGG/caching.py

    r1873 r1875  
    5555            raise KeyError(key) 
    5656        else: 
    57             return pickle.loads(str(r[0][0])) 
     57            pickle_str = str(r[0][0]) 
     58            try: 
     59                return pickle.loads(pickle_str) 
     60            except Exception: 
     61                raise KeyError(key) 
    5862 
    5963    def __setitem__(self, key, value): 
Note: See TracChangeset for help on using the changeset viewer.