[kupfer: 28/67] commandexec: Allow passing a simple exception object as error
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [kupfer: 28/67] commandexec: Allow passing a simple exception object as error
- Date: Sat, 19 Mar 2011 01:00:05 +0000 (UTC)
commit 384a6f81eb825d716de5c6a4a1f527ee02294e6d
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Tue Mar 15 22:52:31 2011 +0100
commandexec: Allow passing a simple exception object as error
kupfer/commandexec.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/commandexec.py b/kupfer/commandexec.py
index b5c5fc3..ce6234c 100644
--- a/kupfer/commandexec.py
+++ b/kupfer/commandexec.py
@@ -194,6 +194,8 @@ class ActionExecutionContext (gobject.GObject, pretty.OutputMixin):
"Register an error in exc_info. The error must be an OperationError"
if exc_info is None:
exc_info = sys.exc_info()
+ if isinstance(exc_info, Exception):
+ exc_info = (type(exc_info), exc_info, None)
command_id, cmdtuple = token
self._do_error_conversion(cmdtuple, exc_info)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]