Commit 3f095bf7e66abb63960957f20271facdc400b595

Authored by Jürgen Knödlseder
1 parent 735df659

Remove catching of exception text as this does not work for Python < 2.6.

test/test_ctbin.py
... ... @@ -83,8 +83,10 @@ class Test(gammalib.GPythonTestSuite):
83 83 try:
84 84 bin.run()
85 85 self.test_try_success()
86   - except Exception as e:
87   - msg = "Exception occured in ctbin: %s." % (e,)
  86 + #except Exception as e:
  87 + # msg = "Exception occured in ctbin: %s." % (e,)
  88 + except:
  89 + msg = "Exception occured in ctbin."
88 90 self.test_try_failure(msg)
89 91  
90 92 # Save counts cube
... ... @@ -92,8 +94,10 @@ class Test(gammalib.GPythonTestSuite):
92 94 try:
93 95 bin.save()
94 96 self.test_try_success()
95   - except Exception as e:
96   - msg = "Exception occured in saving counts cube: %s." % (e,)
  97 + #except Exception as e:
  98 + # msg = "Exception occured in saving counts cube: %s." % (e,)
  99 + except:
  100 + msg = "Exception occured in saving counts cube."
97 101 self.test_try_failure(msg)
98 102  
99 103 # Return
... ...
test/test_ctbkgcube.py
... ... @@ -91,8 +91,10 @@ class Test(gammalib.GPythonTestSuite):
91 91 try:
92 92 bkgcube.run()
93 93 self.test_try_success()
94   - except Exception as e:
95   - msg = "Exception occured in ctbkgcube: %s." % (e,)
  94 + #except Exception as e:
  95 + # msg = "Exception occured in ctbkgcube: %s." % (e,)
  96 + except:
  97 + msg = "Exception occured in ctbkgcube."
96 98 self.test_try_failure(msg)
97 99  
98 100 # Save background cube
... ... @@ -100,8 +102,10 @@ class Test(gammalib.GPythonTestSuite):
100 102 try:
101 103 bkgcube.save()
102 104 self.test_try_success()
103   - except Exception as e:
104   - msg = "Exception occured in saving background cube: %s." % (e,)
  105 + #except Exception as e:
  106 + # msg = "Exception occured in saving background cube: %s." % (e,)
  107 + except:
  108 + msg = "Exception occured in saving background cube."
105 109 self.test_try_failure(msg)
106 110  
107 111 # Return
... ...
test/test_ctbutterfly.py
... ... @@ -81,8 +81,10 @@ class Test(gammalib.GPythonTestSuite):
81 81 try:
82 82 butterfly.run()
83 83 self.test_try_success()
84   - except Exception as e:
85   - msg = "Exception occured in ctbutterfly: %s." % (e,)
  84 + #except Exception as e:
  85 + # msg = "Exception occured in ctbutterfly: %s." % (e,)
  86 + except:
  87 + msg = "Exception occured in ctbutterfly."
86 88 self.test_try_failure(msg)
87 89  
88 90 # Save results
... ... @@ -90,8 +92,10 @@ class Test(gammalib.GPythonTestSuite):
90 92 try:
91 93 butterfly.save()
92 94 self.test_try_success()
93   - except Exception as e:
94   - msg = "Exception occured in saving butterfly diagram: %s." % (e,)
  95 + #except Exception as e:
  96 + # msg = "Exception occured in saving butterfly diagram: %s." % (e,)
  97 + except:
  98 + msg = "Exception occured in saving butterfly diagram."
95 99 self.test_try_failure(msg)
96 100  
97 101 # Return
... ...
test/test_ctcubemask.py
... ... @@ -79,8 +79,10 @@ class Test(gammalib.GPythonTestSuite):
79 79 try:
80 80 mask.run()
81 81 self.test_try_success()
82   - except Exception as e:
83   - msg = "Exception occured in ctcubemask: %s." % (e,)
  82 + #except Exception as e:
  83 + # msg = "Exception occured in ctcubemask: %s." % (e,)
  84 + except:
  85 + msg = "Exception occured in ctcubemask."
84 86 self.test_try_failure(msg)
85 87  
86 88 # Save counts cube
... ... @@ -88,8 +90,10 @@ class Test(gammalib.GPythonTestSuite):
88 90 try:
89 91 mask.save()
90 92 self.test_try_success()
91   - except Exception as e:
92   - msg = "Exception occured in saving counts cube: %s." % (e,)
  93 + #except Exception as e:
  94 + # msg = "Exception occured in saving counts cube: %s." % (e,)
  95 + except:
  96 + msg = "Exception occured in saving counts cube."
93 97 self.test_try_failure(msg)
94 98  
95 99 # Return
... ...
test/test_cterror.py
... ... @@ -80,8 +80,10 @@ class Test(gammalib.GPythonTestSuite):
80 80 try:
81 81 error.run()
82 82 self.test_try_success()
83   - except Exception as e:
84   - msg = "Exception occured in cterror: %s." % (e,)
  83 + #except Exception as e:
  84 + # msg = "Exception occured in cterror: %s." % (e,)
  85 + except:
  86 + msg = "Exception occured in cterror."
85 87 self.test_try_failure(msg)
86 88  
87 89 # Save results
... ... @@ -89,8 +91,10 @@ class Test(gammalib.GPythonTestSuite):
89 91 try:
90 92 error.save()
91 93 self.test_try_success()
92   - except Exception as e:
93   - msg = "Exception occured in saving results: %s." % (e,)
  94 + #except Exception as e:
  95 + # msg = "Exception occured in saving results: %s." % (e,)
  96 + except:
  97 + msg = "Exception occured in saving results."
94 98 self.test_try_failure(msg)
95 99  
96 100 # Return
... ...
test/test_ctexpcube.py
... ... @@ -88,8 +88,10 @@ class Test(gammalib.GPythonTestSuite):
88 88 try:
89 89 expcube.run()
90 90 self.test_try_success()
91   - except Exception as e:
92   - msg = "Exception occured in ctexpcube: %s." % (e,)
  91 + #except Exception as e:
  92 + # msg = "Exception occured in ctexpcube: %s." % (e,)
  93 + except:
  94 + msg = "Exception occured in ctexpcube."
93 95 self.test_try_failure(msg)
94 96  
95 97 # Save exposure cube
... ... @@ -97,8 +99,10 @@ class Test(gammalib.GPythonTestSuite):
97 99 try:
98 100 expcube.save()
99 101 self.test_try_success()
100   - except Exception as e:
101   - msg = "Exception occured in saving exposure cube: %s." % (e,)
  102 + #except Exception as e:
  103 + # msg = "Exception occured in saving exposure cube: %s." % (e,)
  104 + except:
  105 + msg = "Exception occured in saving exposure cube."
102 106 self.test_try_failure(msg)
103 107  
104 108 # Return
... ...
test/test_ctlike.py
... ... @@ -78,8 +78,10 @@ class Test(gammalib.GPythonTestSuite):
78 78 try:
79 79 like.run()
80 80 self.test_try_success()
81   - except Exception as e:
82   - msg = "Exception occured in ctlike: %s." % (e,)
  81 + #except Exception as e:
  82 + # msg = "Exception occured in ctlike: %s." % (e,)
  83 + except:
  84 + msg = "Exception occured in ctlike."
83 85 self.test_try_failure(msg)
84 86  
85 87 # Save results
... ... @@ -87,8 +89,10 @@ class Test(gammalib.GPythonTestSuite):
87 89 try:
88 90 like.save()
89 91 self.test_try_success()
90   - except Exception as e:
91   - msg = "Exception occured in saving results: %s." % (e,)
  92 + #except Exception as e:
  93 + # msg = "Exception occured in saving results: %s." % (e,)
  94 + except:
  95 + msg = "Exception occured in saving results."
92 96 self.test_try_failure(msg)
93 97  
94 98 # Return
... ...
test/test_ctmodel.py
... ... @@ -96,8 +96,10 @@ class Test(gammalib.GPythonTestSuite):
96 96 try:
97 97 model.run()
98 98 self.test_try_success()
99   - except Exception as e:
100   - msg = "Exception occured in ctmodel: %s." % (e,)
  99 + #except Exception as e:
  100 + # msg = "Exception occured in ctmodel: %s." % (e,)
  101 + except:
  102 + msg = "Exception occured in ctmodel."
101 103 self.test_try_failure(msg)
102 104  
103 105 # Save counts cube
... ... @@ -105,8 +107,10 @@ class Test(gammalib.GPythonTestSuite):
105 107 try:
106 108 model.save()
107 109 self.test_try_success()
108   - except Exception as e:
109   - msg = "Exception occured in saving model cube: %s." % (e,)
  110 + #except Exception as e:
  111 + # msg = "Exception occured in saving model cube: %s." % (e,)
  112 + except:
  113 + msg = "Exception occured in saving model cube."
110 114 self.test_try_failure(msg)
111 115  
112 116 # Return
... ...
test/test_ctobssim.py
... ... @@ -84,8 +84,10 @@ class Test(gammalib.GPythonTestSuite):
84 84 try:
85 85 sim.run()
86 86 self.test_try_success()
87   - except Exception as e:
88   - msg = "Exception occured in ctobssim: %s." % (e,)
  87 + #except Exception as e:
  88 + # msg = "Exception occured in ctobssim: %s." % (e,)
  89 + except:
  90 + msg = "Exception occured in ctobssim."
89 91 self.test_try_failure(msg)
90 92  
91 93 # Retrieve observation and check content
... ... @@ -105,8 +107,10 @@ class Test(gammalib.GPythonTestSuite):
105 107 try:
106 108 sim.save()
107 109 self.test_try_success()
108   - except Exception as e:
109   - msg = "Exception occured in saving events: %s." % (e,)
  110 + #except Exception as e:
  111 + # msg = "Exception occured in saving events: %s." % (e,)
  112 + except:
  113 + msg = "Exception occured in saving events."
110 114 self.test_try_failure(msg)
111 115  
112 116 # Test ctobssim on observation container
... ... @@ -126,8 +130,10 @@ class Test(gammalib.GPythonTestSuite):
126 130 try:
127 131 sim.run()
128 132 self.test_try_success()
129   - except Exception as e:
130   - msg = "Exception occured in ctobssim: %s." % (e,)
  133 + #except Exception as e:
  134 + # msg = "Exception occured in ctobssim: %s." % (e,)
  135 + except:
  136 + msg = "Exception occured in ctobssim."
131 137 self.test_try_failure(msg)
132 138  
133 139 # Retrieve observation and check content
... ... @@ -138,8 +144,10 @@ class Test(gammalib.GPythonTestSuite):
138 144 try:
139 145 sim.save()
140 146 self.test_try_success()
141   - except Exception as e:
142   - msg = "Exception occured in saving events: %s." % (e,)
  147 + #except Exception as e:
  148 + # msg = "Exception occured in saving events: %s." % (e,)
  149 + except:
  150 + msg = "Exception occured in saving events."
143 151 self.test_try_failure(msg)
144 152  
145 153 # Setup observation container
... ...
test/test_ctpsfcube.py
... ... @@ -90,8 +90,10 @@ class Test(gammalib.GPythonTestSuite):
90 90 try:
91 91 psfcube.run()
92 92 self.test_try_success()
93   - except Exception as e:
94   - msg = "Exception occured in ctpsfcube: %s." % (e,)
  93 + #except Exception as e:
  94 + # msg = "Exception occured in ctpsfcube: %s." % (e,)
  95 + except:
  96 + msg = "Exception occured in ctpsfcube."
95 97 self.test_try_failure(msg)
96 98  
97 99 # Save PSF cube
... ... @@ -99,8 +101,10 @@ class Test(gammalib.GPythonTestSuite):
99 101 try:
100 102 psfcube.save()
101 103 self.test_try_success()
102   - except Exception as e:
103   - msg = "Exception occured in saving PSF cube: %s." % (e,)
  104 + #except Exception as e:
  105 + # msg = "Exception occured in saving PSF cube: %s." % (e,)
  106 + except:
  107 + msg = "Exception occured in saving PSF cubes."
104 108 self.test_try_failure(msg)
105 109  
106 110 # Return
... ...
test/test_ctselect.py
... ... @@ -79,8 +79,10 @@ class Test(gammalib.GPythonTestSuite):
79 79 try:
80 80 select.run()
81 81 self.test_try_success()
82   - except Exception as e:
83   - msg = "Exception occured in ctselect: %s." % (e,)
  82 + #except Exception as e:
  83 + # msg = "Exception occured in ctselect: %s." % (e,)
  84 + except:
  85 + msg = "Exception occured in ctselect."
84 86 self.test_try_failure(msg)
85 87  
86 88 # Save events
... ... @@ -88,8 +90,10 @@ class Test(gammalib.GPythonTestSuite):
88 90 try:
89 91 select.save()
90 92 self.test_try_success()
91   - except Exception as e:
92   - msg = "Exception occured in saving events: %s." % (e,)
  93 + #except Exception as e:
  94 + # msg = "Exception occured in saving events: %s." % (e,)
  95 + except:
  96 + msg = "Exception occured in saving events."
93 97 self.test_try_failure(msg)
94 98  
95 99 # Return
... ...
test/test_ctskymap.py
... ... @@ -81,8 +81,10 @@ class Test(gammalib.GPythonTestSuite):
81 81 try:
82 82 skymap.run()
83 83 self.test_try_success()
84   - except Exception as e:
85   - msg = "Exception occured in ctskymap: %s." % (e,)
  84 + #except Exception as e:
  85 + # msg = "Exception occured in ctskymap: %s." % (e,)
  86 + except:
  87 + msg = "Exception occured in ctskymap."
86 88 self.test_try_failure(msg)
87 89  
88 90 # Save counts cube
... ... @@ -90,8 +92,10 @@ class Test(gammalib.GPythonTestSuite):
90 92 try:
91 93 skymap.save()
92 94 self.test_try_success()
93   - except Exception as e:
94   - msg = "Exception occured in saving sky map: %s." % (e,)
  95 + #except Exception as e:
  96 + # msg = "Exception occured in saving sky map: %s." % (e,)
  97 + except:
  98 + msg = "Exception occured in saving sky map."
95 99 self.test_try_failure(msg)
96 100  
97 101 # Return
... ...
test/test_cttsmap.py
... ... @@ -86,8 +86,10 @@ class Test(gammalib.GPythonTestSuite):
86 86 try:
87 87 tsmap.run()
88 88 self.test_try_success()
89   - except Exception as e:
90   - msg = "Exception occured in cttsmap: %s." % (e,)
  89 + #except Exception as e:
  90 + # msg = "Exception occured in cttsmap: %s." % (e,)
  91 + except:
  92 + msg = "Exception occured in cttsmap."
91 93 self.test_try_failure(msg)
92 94  
93 95 # Save results
... ... @@ -95,8 +97,10 @@ class Test(gammalib.GPythonTestSuite):
95 97 try:
96 98 tsmap.save()
97 99 self.test_try_success()
98   - except Exception as e:
99   - msg = "Exception occured in saving results: %s." % (e,)
  100 + #except Exception as e:
  101 + # msg = "Exception occured in saving results: %s." % (e,)
  102 + except:
  103 + msg = "Exception occured in saving results."
100 104 self.test_try_failure(msg)
101 105  
102 106 # Return
... ...
test/test_ctulimit.py
... ... @@ -78,8 +78,10 @@ class Test(gammalib.GPythonTestSuite):
78 78 try:
79 79 ulimit.run()
80 80 self.test_try_success()
81   - except Exception as e:
82   - msg = "Exception occured in ctulimit: %s." % (e,)
  81 + #except Exception as e:
  82 + # msg = "Exception occured in ctulimit: %s." % (e,)
  83 + except:
  84 + msg = "Exception occured in ctulimit."
83 85 self.test_try_failure(msg)
84 86  
85 87 # Save results
... ... @@ -87,8 +89,10 @@ class Test(gammalib.GPythonTestSuite):
87 89 try:
88 90 ulimit.save()
89 91 self.test_try_success()
90   - except Exception as e:
91   - msg = "Exception occured in saving results: %s." % (e,)
  92 + #except Exception as e:
  93 + # msg = "Exception occured in saving results: %s." % (e,)
  94 + except:
  95 + msg = "Exception occured in saving results."
92 96 self.test_try_failure(msg)
93 97  
94 98 # Return
... ...