Commit 0d048c18a089de57948f9fdf2953e3b18ba54f1d
1 parent
862f5bcb
Fix compatibility issue with Python 2.3-2.5
Showing
1 changed file
with
3 additions
and
4 deletions
cscripts/cssens.py
| ... | ... | @@ -557,10 +557,9 @@ class cssens(ctools.csobservation): |
| 557 | 557 | try: |
| 558 | 558 | pred_crab_flux, regcoeff = self._predict_flux(results, ts_thres) |
| 559 | 559 | correct = pred_crab_flux / crab_flux |
| 560 | - except Exception as e: | |
| 561 | - # If the regression fails, retain the simple scaling with | |
| 562 | - # ts_thres | |
| 563 | - self._log_value(gammalib.TERSE, 'Skipping failed regression', e) | |
| 560 | + except: | |
| 561 | + self._log_value(gammalib.TERSE, 'Skipping failed regression', | |
| 562 | + 'Retain simple TS scaling relation') | |
| 564 | 563 | |
| 565 | 564 | # Compute extrapolated fluxes based on the flux correction factor |
| 566 | 565 | crab_flux = correct * crab_flux | ... | ... |