Commit affec65d authored by Hamza Dely's avatar Hamza Dely

Gest_crans_lc affiche correctement les erreurs qui sont des unicodes

parent 9d3e5c74
......@@ -183,9 +183,15 @@ class TailCall(object) :
return call(*self.args, **self.kwargs)
def unicode_of_Error(x):
"""Formatte des exception"""
return u"\n".join(unicode(i, 'utf-8') if type(i) == str
else repr(i) for i in x.args)
"""Formatte des exceptions"""
def _exc_formatter(element):
if isinstance(element, str):
return element.decode('utf-8')
elif isinstance(element, unicode):
return element
return repr(element)
return "\n".join(_exc_formatter(i) for i in x.args)
def raiseKeyboardInterrupt(x, y):
"""fonction utilisée pour réactiver les Ctrl-C"""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment