Changeset 13619


Ignore:
Timestamp:
Sep 30, 2019 4:44:53 PM (2 months ago)
Author:
randersson
Message:

#5819 Testing if the following fix enables us to remove the conversion of keys to bytes. Also added the import of py3 flag in compiler_logging

Location:
branches/dev-5819/Python/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-5819/Python/src/pymodelica/compiler_logging.py

    r13618 r13619  
    4545                self.state == 'exception' or self.state == 'unit':
    4646            if name == 'value':
    47                 self.attribute = attrs['name'].encode('utf-8')
     47                self.attribute = str(attrs['name'])
    4848                self.node[self.attribute] = ''
    4949        else:
     
    7070            self.node = None
    7171        elif self.state == 'unit' and name == "CompilationUnit":
    72             self.result.name = self.node[b'file']
     72            self.result.name = self.node['file']
    7373            self.state = None
    7474            self.node = None
     
    8282    def _construct_problem_node(self, node):
    8383        if node['type'] == 'exception':
    84             return CompilationException(node[b'kind'], node[b'message'], node[b'stacktrace'])
     84            return CompilationException(node['kind'], node['message'], node['stacktrace'])
    8585        elif node['type'] == 'error':
    86             return CompilationError(node[b'identifier'], node[b'kind'], node[b'file'], node[b'line'], \
    87                 node[b'column'], node[b'message'])
     86            return CompilationError(node['identifier'], node['kind'], node['file'], node['line'], \
     87                node['column'], node['message'])
    8888        elif node['type'] == 'warning':
    89             return CompilationWarning(node[b'identifier'], node[b'kind'], node[b'file'], node[b'line'], \
    90                 node[b'column'], node[b'message'])
     89            return CompilationWarning(node['identifier'], node['kind'], node['file'], node['line'], \
     90                node['column'], node['message'])
    9191
    9292class KeepLastStream():
  • branches/dev-5819/Python/src/tests_jmodelica/__init__.py

    r13543 r13619  
    2727import shutil
    2828import platform
     29from pyjmi.common import python3_flag
    2930
    3031__all__ = ['general', 'initialization', 'optimization', 'simulation',
     
    7677                               " variable."
    7778    pycompiler = platform.python_compiler()
    78     if sys.version_info > (3, 0):
     79    if python3_flag:
    7980        return os.path.join(jmhome, 'Python', 'tests_jmodelica', 'files')
    8081    elif "64 bit" in pycompiler and "win" in sys.platform:
Note: See TracChangeset for help on using the changeset viewer.