You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2020/02/10 22:45:09 UTC

[allura] 38/41: [#8349] python-modernize -n -w --no-diffs -f six_raise .

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/8349
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 7dabc2c13a19a703b6affc2db799a987a2dba2c1
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Feb 10 17:02:12 2020 -0500

    [#8349] python-modernize -n -w --no-diffs -f six_raise .
---
 Allura/allura/tasks/event_tasks.py | 3 ++-
 Allura/allura/tasks/index_tasks.py | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Allura/allura/tasks/event_tasks.py b/Allura/allura/tasks/event_tasks.py
index fe537cd..11e04ce 100644
--- a/Allura/allura/tasks/event_tasks.py
+++ b/Allura/allura/tasks/event_tasks.py
@@ -20,6 +20,7 @@ import sys
 
 from allura.lib.decorators import task, event_handler
 from allura.lib.exceptions import CompoundError
+import six
 
 
 @task
@@ -32,6 +33,6 @@ def event(event_type, *args, **kwargs):
             exceptions.append(sys.exc_info())
     if exceptions:
         if len(exceptions) == 1:
-            raise exceptions[0][0], exceptions[0][1], exceptions[0][2]
+            six.reraise(exceptions[0][0], exceptions[0][1], exceptions[0][2])
         else:
             raise CompoundError(*exceptions)
diff --git a/Allura/allura/tasks/index_tasks.py b/Allura/allura/tasks/index_tasks.py
index 07ce887..a20dcfc 100644
--- a/Allura/allura/tasks/index_tasks.py
+++ b/Allura/allura/tasks/index_tasks.py
@@ -28,6 +28,7 @@ from allura.lib import helpers as h
 from allura.lib.decorators import task
 from allura.lib.exceptions import CompoundError
 from allura.lib.solr import make_solr_from_config
+import six
 
 
 log = logging.getLogger(__name__)
@@ -112,7 +113,7 @@ def add_artifacts(ref_ids, update_solr=True, update_refs=True, solr_hosts=None):
         __get_solr(solr_hosts).add(solr_updates)
 
     if len(exceptions) == 1:
-        raise exceptions[0][0], exceptions[0][1], exceptions[0][2]
+        six.reraise(exceptions[0][0], exceptions[0][1], exceptions[0][2])
     if exceptions:
         raise CompoundError(*exceptions)