From 735df6597f17e87ce27d81ad7fea159c68fbcab0 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Thu, 25 Feb 2016 10:08:37 +0100 Subject: [PATCH] Use "Exception as e" instead of "Exception, e" to make test scripts compatible with Python 3. --- test/test_ctbin.py | 4 ++-- test/test_ctbkgcube.py | 4 ++-- test/test_ctbutterfly.py | 4 ++-- test/test_ctcubemask.py | 4 ++-- test/test_cterror.py | 4 ++-- test/test_ctexpcube.py | 4 ++-- test/test_ctlike.py | 4 ++-- test/test_ctmodel.py | 4 ++-- test/test_ctobssim.py | 8 ++++---- test/test_ctpsfcube.py | 4 ++-- test/test_ctselect.py | 4 ++-- test/test_ctskymap.py | 4 ++-- test/test_cttsmap.py | 4 ++-- test/test_ctulimit.py | 4 ++-- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/test_ctbin.py b/test/test_ctbin.py index 29fcc1a..cc2f80d 100755 --- a/test/test_ctbin.py +++ b/test/test_ctbin.py @@ -83,7 +83,7 @@ class Test(gammalib.GPythonTestSuite): try: bin.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctbin: %s." % (e,) self.test_try_failure(msg) @@ -92,7 +92,7 @@ class Test(gammalib.GPythonTestSuite): try: bin.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving counts cube: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_ctbkgcube.py b/test/test_ctbkgcube.py index 6a1a2b4..980cce2 100755 --- a/test/test_ctbkgcube.py +++ b/test/test_ctbkgcube.py @@ -91,7 +91,7 @@ class Test(gammalib.GPythonTestSuite): try: bkgcube.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctbkgcube: %s." % (e,) self.test_try_failure(msg) @@ -100,7 +100,7 @@ class Test(gammalib.GPythonTestSuite): try: bkgcube.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving background cube: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_ctbutterfly.py b/test/test_ctbutterfly.py index 18542ad..8f1acfa 100755 --- a/test/test_ctbutterfly.py +++ b/test/test_ctbutterfly.py @@ -81,7 +81,7 @@ class Test(gammalib.GPythonTestSuite): try: butterfly.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctbutterfly: %s." % (e,) self.test_try_failure(msg) @@ -90,7 +90,7 @@ class Test(gammalib.GPythonTestSuite): try: butterfly.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving butterfly diagram: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_ctcubemask.py b/test/test_ctcubemask.py index 83c940c..b081f7c 100755 --- a/test/test_ctcubemask.py +++ b/test/test_ctcubemask.py @@ -79,7 +79,7 @@ class Test(gammalib.GPythonTestSuite): try: mask.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctcubemask: %s." % (e,) self.test_try_failure(msg) @@ -88,7 +88,7 @@ class Test(gammalib.GPythonTestSuite): try: mask.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving counts cube: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_cterror.py b/test/test_cterror.py index f9774a6..741aec7 100755 --- a/test/test_cterror.py +++ b/test/test_cterror.py @@ -80,7 +80,7 @@ class Test(gammalib.GPythonTestSuite): try: error.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in cterror: %s." % (e,) self.test_try_failure(msg) @@ -89,7 +89,7 @@ class Test(gammalib.GPythonTestSuite): try: error.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving results: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_ctexpcube.py b/test/test_ctexpcube.py index 8995736..8c31f42 100755 --- a/test/test_ctexpcube.py +++ b/test/test_ctexpcube.py @@ -88,7 +88,7 @@ class Test(gammalib.GPythonTestSuite): try: expcube.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctexpcube: %s." % (e,) self.test_try_failure(msg) @@ -97,7 +97,7 @@ class Test(gammalib.GPythonTestSuite): try: expcube.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving exposure cube: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_ctlike.py b/test/test_ctlike.py index 646fa2b..20e8c8b 100755 --- a/test/test_ctlike.py +++ b/test/test_ctlike.py @@ -78,7 +78,7 @@ class Test(gammalib.GPythonTestSuite): try: like.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctlike: %s." % (e,) self.test_try_failure(msg) @@ -87,7 +87,7 @@ class Test(gammalib.GPythonTestSuite): try: like.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving results: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_ctmodel.py b/test/test_ctmodel.py index c3b3dd5..1202913 100755 --- a/test/test_ctmodel.py +++ b/test/test_ctmodel.py @@ -96,7 +96,7 @@ class Test(gammalib.GPythonTestSuite): try: model.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctmodel: %s." % (e,) self.test_try_failure(msg) @@ -105,7 +105,7 @@ class Test(gammalib.GPythonTestSuite): try: model.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving model cube: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_ctobssim.py b/test/test_ctobssim.py index 483cac4..80a9198 100755 --- a/test/test_ctobssim.py +++ b/test/test_ctobssim.py @@ -84,7 +84,7 @@ class Test(gammalib.GPythonTestSuite): try: sim.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctobssim: %s." % (e,) self.test_try_failure(msg) @@ -105,7 +105,7 @@ class Test(gammalib.GPythonTestSuite): try: sim.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving events: %s." % (e,) self.test_try_failure(msg) @@ -126,7 +126,7 @@ class Test(gammalib.GPythonTestSuite): try: sim.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctobssim: %s." % (e,) self.test_try_failure(msg) @@ -138,7 +138,7 @@ class Test(gammalib.GPythonTestSuite): try: sim.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving events: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_ctpsfcube.py b/test/test_ctpsfcube.py index bf6e500..996b2eb 100755 --- a/test/test_ctpsfcube.py +++ b/test/test_ctpsfcube.py @@ -90,7 +90,7 @@ class Test(gammalib.GPythonTestSuite): try: psfcube.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctpsfcube: %s." % (e,) self.test_try_failure(msg) @@ -99,7 +99,7 @@ class Test(gammalib.GPythonTestSuite): try: psfcube.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving PSF cube: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_ctselect.py b/test/test_ctselect.py index f4c7c7d..b9ca40e 100755 --- a/test/test_ctselect.py +++ b/test/test_ctselect.py @@ -79,7 +79,7 @@ class Test(gammalib.GPythonTestSuite): try: select.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctselect: %s." % (e,) self.test_try_failure(msg) @@ -88,7 +88,7 @@ class Test(gammalib.GPythonTestSuite): try: select.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving events: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_ctskymap.py b/test/test_ctskymap.py index c10a82a..676ab21 100755 --- a/test/test_ctskymap.py +++ b/test/test_ctskymap.py @@ -81,7 +81,7 @@ class Test(gammalib.GPythonTestSuite): try: skymap.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctskymap: %s." % (e,) self.test_try_failure(msg) @@ -90,7 +90,7 @@ class Test(gammalib.GPythonTestSuite): try: skymap.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving sky map: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_cttsmap.py b/test/test_cttsmap.py index 41baf6c..300bedf 100755 --- a/test/test_cttsmap.py +++ b/test/test_cttsmap.py @@ -86,7 +86,7 @@ class Test(gammalib.GPythonTestSuite): try: tsmap.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in cttsmap: %s." % (e,) self.test_try_failure(msg) @@ -95,7 +95,7 @@ class Test(gammalib.GPythonTestSuite): try: tsmap.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving results: %s." % (e,) self.test_try_failure(msg) diff --git a/test/test_ctulimit.py b/test/test_ctulimit.py index 69a4d03..c405c8b 100755 --- a/test/test_ctulimit.py +++ b/test/test_ctulimit.py @@ -78,7 +78,7 @@ class Test(gammalib.GPythonTestSuite): try: ulimit.run() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in ctulimit: %s." % (e,) self.test_try_failure(msg) @@ -87,7 +87,7 @@ class Test(gammalib.GPythonTestSuite): try: ulimit.save() self.test_try_success() - except Exception, e: + except Exception as e: msg = "Exception occured in saving results: %s." % (e,) self.test_try_failure(msg) -- libgit2 0.21.4