projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
086e4a2
)
For python 2.6, don't try to use Exception.message
author
P. Christeas
<p_christ@hol.gr>
Mon, 16 Feb 2009 18:39:33 +0000
(20:39 +0200)
committer
P. Christeas
<p_christ@hol.gr>
Mon, 16 Feb 2009 18:39:33 +0000
(20:39 +0200)
bzr revid: p_christ@hol.gr-
20090216183933
-4w10k79yzal4fcfl
bin/tools/misc.py
patch
|
blob
|
history
diff --git
a/bin/tools/misc.py
b/bin/tools/misc.py
index
8863a8c
..
cba90e6
100644
(file)
--- a/
bin/tools/misc.py
+++ b/
bin/tools/misc.py
@@
-692,14
+692,14
@@
def ustr(value):
return unicode(value, getlocale()[1])
def exception_to_unicode(e):
- if hasattr(e, 'message'):
+ if (sys.version_info[:2] < (2,6)) and hasattr(e, 'message'):
return ustr(e.message)
if hasattr(e, 'args'):
return "\n".join((ustr(a) for a in e.args))
try:
return ustr(e)
except:
- return u"Unknow message"
+ return u"Unknown message"
# to be compatible with python 2.4