From 0d048c18a089de57948f9fdf2953e3b18ba54f1d Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Fri, 21 May 2021 08:25:40 +0200 Subject: [PATCH] Fix compatibility issue with Python 2.3-2.5 --- cscripts/cssens.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cscripts/cssens.py b/cscripts/cssens.py index 650ed3a..55f230a 100755 --- a/cscripts/cssens.py +++ b/cscripts/cssens.py @@ -557,10 +557,9 @@ class cssens(ctools.csobservation): try: pred_crab_flux, regcoeff = self._predict_flux(results, ts_thres) correct = pred_crab_flux / crab_flux - except Exception as e: - # If the regression fails, retain the simple scaling with - # ts_thres - self._log_value(gammalib.TERSE, 'Skipping failed regression', e) + except: + self._log_value(gammalib.TERSE, 'Skipping failed regression', + 'Retain simple TS scaling relation') # Compute extrapolated fluxes based on the flux correction factor crab_flux = correct * crab_flux -- libgit2 0.21.4