Commit e536202f authored by Maxime Perrotin's avatar Maxime Perrotin

Fix unicode issues

parent 4bd3b375
......@@ -1339,7 +1339,8 @@ def _call_external_function(output, **kwargs):
.format(out['outputName'])]
except ValueError:
# Not there? Impossible, the parser would have barked
raise ValueError(u'Probably a bug - please report')
raise ValueError(u'Probably a bug - please report'
' (related to ' + signal_name.lower() + ')')
if out_sig:
for idx, param in enumerate(out.get('params') or []):
param_direction = 'in'
......@@ -1938,7 +1939,7 @@ def _prim_selector(prim, **kwargs):
and not kwargs.get("readonly", 0):
# Must set Exist only when assigning value, not each time it is
# accessed: this is what "readonly" ensures.
stmts.append('{}.Exist.{} := 1;'.format(ada_string, field_name))
stmts.append(u'{}.Exist.{} := 1;'.format(ada_string, field_name))
ada_string += '.' + field_name
return stmts, unicode(ada_string), local_decl
......
......@@ -2395,6 +2395,7 @@ clean:
AdaGenerator.generate(process)
self.messages_window.addItem('Done')
except (TypeError, ValueError, NameError) as err:
err=unicode(err).encode('utf8')
self.messages_window.addItem(
'Code generation failed:' + str(err))
LOG.debug(str(traceback.format_exc()))
......@@ -3018,6 +3019,8 @@ def generate(process, options):
taste=options.taste_target)
except (TypeError, ValueError, NameError) as err:
ret = 1
err = unicode(err).replace(u'\u00fc', '.')
err = err.encode('utf-8')
LOG.error(str(err))
LOG.debug(str(traceback.format_exc()))
LOG.error('Ada code generation failed')
......
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