Changeset 13847


Ignore:
Timestamp:
Oct 25, 2019 8:48:48 AM (3 weeks ago)
Author:
aramle
Message:

#5819 Updating to Python 3 compatibility.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • PyFMI/trunk/src/pyfmi/fmi.pyx

    r13844 r13847  
    42034203                    self.set_integer([ref], [enum_values[encode(value)]])
    42044204                except KeyError:
    4205                     raise FMUException("The value '%s' is not in the list of allowed enumeration items for variable '%s'. Allowed values: %s'"%(value, variable_name, ", ".join(enum_values.keys())))
     4205                    str_keys = [decode(k) for k in enum_values.keys()]
     4206                    msg = "The value '{}' is not in the list of allowed enumeration items for variable '{}'. Allowed values: {}'.".format(decode(value), decode(variable_name), ", ".join(str_keys))
     4207                    raise FMUException(msg)
    42064208            else:
    42074209                self.set_integer([ref], [value])
Note: See TracChangeset for help on using the changeset viewer.