Beispiel #1
0
def basic_test_7():
    old_use_exceptions_status = gdal.GetUseExceptions()
    gdal.UseExceptions()
    ret = basic_test_7_internal()
    if old_use_exceptions_status == 0:
        gdal.DontUseExceptions()
    return ret
Beispiel #2
0
def setGdalException(e=True):
    old = gdal.GetUseExceptions()
    if e:
        gdal.PushErrorHandler(GdalErrorHandler().handler)
        gdal.UseExceptions()
    else:
        gdal.DontUseExceptions()
        gdal.PopErrorHandler()
    return old == 1
Beispiel #3
0
def _RaiseException():
    if gdal.GetUseExceptions():
        _StoreLastException()
        raise RuntimeError(gdal.GetLastErrorMsg())