Commit adb18c6c167387af9b4225e9c15edb8c4e9dcd64
1 parent
eb409db8
Put warning for missing module in the code core.
Showing
1 changed file
with
6 additions
and
2 deletions
cscripts/csroot2caldb.py
| ... | ... | @@ -27,10 +27,9 @@ from datetime import datetime |
| 27 | 27 | |
| 28 | 28 | # Optional ROOT import |
| 29 | 29 | try: |
| 30 | - from ROOT import TFile, TH2F, TH3F | |
| 30 | + from ROOTx import TFile, TH2F, TH3F | |
| 31 | 31 | _has_root = True |
| 32 | 32 | except: |
| 33 | - print('ROOT module not present, so csroot2caldb script will not work.') | |
| 34 | 33 | _has_root = False |
| 35 | 34 | |
| 36 | 35 | |
| ... | ... | @@ -1228,6 +1227,11 @@ class csroot2caldb(ctools.cscript): |
| 1228 | 1227 | """ |
| 1229 | 1228 | Run the script. |
| 1230 | 1229 | """ |
| 1230 | + # Warn if ROOT module is missing | |
| 1231 | + if not _has_root: | |
| 1232 | + gammalib.warning('csroot2caldb', 'ROOT Python module not present, ' | |
| 1233 | + 'script will create empty IRF.') | |
| 1234 | + | |
| 1231 | 1235 | # Switch screen logging on in debug mode |
| 1232 | 1236 | if self._logDebug(): |
| 1233 | 1237 | self._log.cout(True) | ... | ... |