~ubuntu-branches/debian/experimental/h5py/experimental

« back to all changes in this revision

Viewing changes to h5py/h5e.pyx

  • Committer: Bazaar Package Importer
  • Author(s): Soeren Sonnenburg
  • Date: 2009-09-24 11:08:03 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090924110803-hz0en6f43x8opgj4
Tags: 1.2.1-2
Build-depend on hdf5 >= 1.8.3 and enable api 1.8 (Closes: #548049)

Show diffs side-by-side

added added

removed removed

Lines of Context:
373
373
        raise RuntimeError("Failed to register HDF5 exception callback")
374
374
    return 0
375
375
 
 
376
cdef err_cookie disable_errors() except *:
 
377
    # Temporarily disable errors for the current thread
 
378
    cdef err_cookie cookie
 
379
    H5Eget_auto(&cookie.func, &cookie.data)
 
380
    H5Eset_auto(NULL, NULL)
 
381
    return cookie
 
382
 
 
383
cdef void enable_errors(err_cookie cookie) except *:
 
384
    # Re-enable errors for the current thread
 
385
    cdef herr_t retval
 
386
    retval = H5Eset_auto(cookie.func, cookie.data)
 
387
    if(retval < 0):
 
388
        raise RuntimeError("Cant' re-enable exception support")
 
389
 
 
390
 
376
391