      [
          c_void_p, c_int, c_int, POINTER(c_double), POINTER(c_double),
          POINTER(c_double), POINTER(c_double), c_void_p, c_void_p,
      ],
      errcheck=False
  )
  compute_band_statistics = void_output(
      std_call('GDALComputeRasterStatistics'),
      [c_void_p, c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double), POINTER(c_double), c_void_p, c_void_p],
      errcheck=False
 
</s> remove     errcheck=False
 </s> add  </s> remove         result = smin.value, smax.value, smean.value, sstd.value

        # Check if band is empty (in that case, set all statistics to None)
        if any((math.isnan(val) for val in result)):
 </s> add         # Computation of statistics fails for empty bands.
        try:
            func(*stats_args)
            result = smin.value, smax.value, smean.value, sstd.value
        except GDALException: </s> remove             capi.get_band_statistics(*stats_args)
 </s> add             func = capi.get_band_statistics </s> remove             capi.compute_band_statistics(*stats_args)
 </s> add             func = capi.compute_band_statistics </s> remove import math
 </s> add 
      [
          c_void_p, c_int, c_int, POINTER(c_double), POINTER(c_double),
          POINTER(c_double), POINTER(c_double), c_void_p, c_void_p,
      ],

  )
  compute_band_statistics = void_output(
      std_call('GDALComputeRasterStatistics'),
      [c_void_p, c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double), POINTER(c_double), c_void_p, c_void_p],
      errcheck=False
keep keep keep keep replace keep keep keep keep keep
 Refs #26592 -- Fixed band statistics for empty bands and GDAL 2.1 
django/contrib/gis/gdal/prototypes/raster.py