Ignore:
Timestamp:
Oct 11, 2005, 5:00:44 PM (19 years ago)
Author:
ole
Message:

Caught potential memory problem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • inundation/caching/caching.py

    r1831 r1895  
    12541254     
    12551255
    1256     Ts  = pickler.dumps(T,bin)
    1257     TsC = zlib.compress(Ts,comp_level)
    1258     file.write(TsC)
     1256    try:
     1257      Ts  = pickler.dumps(T,bin)
     1258    except MemoryError:
     1259      msg = '****WARNING (caching.py): Could not pickle data for compression.'
     1260      msg += ' Try using compression = False'
     1261      raise MemoryError, msg
     1262    else: 
     1263      #Compressed pickling     
     1264      TsC = zlib.compress(Ts,comp_level)
     1265      file.write(TsC)
    12591266  else:
    1260     pickler.dump(T,file,bin)
     1267      #Uncompressed pickling
     1268      pickler.dump(T,file,bin)
     1269
     1270     
    12611271
    12621272# -----------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.