Changeset 14102


Ignore:
Timestamp:
Nov 18, 2019 11:56:46 AM (3 weeks ago)
Author:
randersson
Message:

#5819 Merged r14098 to trunk from branch containing fix for use of newer jpype

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/Python/src/pymodelica/compiler_wrappers.py

    r14056 r14102  
    2424from .compiler_interface import *
    2525from .compiler_logging import CompilerLogHandler, LogHandlerThread
    26 from pymodelica.common import python3_flag
    2726from pymodelica.common.core import list_to_string
    2827from .compiler_exceptions import *
    29 
     28from distutils.version import StrictVersion
     29jpype_jexception_compatibility = True if StrictVersion(jpype.__version__) >= '0.7.0' else False
    3030class ModelicaCompiler(object):
    3131    """
     
    4040        Modelica models. A compiler instance can be used multiple times.
    4141        """
    42         self._java_exception = jpype.JException if python3_flag else jpype.JavaException
     42        self._java_exception = jpype.JException if jpype_jexception_compatibility else jpype.JavaException
    4343       
    4444        try:
     
    523523            #  we need to compare the raised exception with the reference exception
    524524            #  in different ways.
    525             return type(raised_ex) is ref_ex if python3_flag else raised_ex.javaClass() is ref_ex
     525            return type(raised_ex) is ref_ex if jpype_jexception_compatibility else raised_ex.javaClass() is ref_ex
    526526
    527527        if _py_handle_exception(ex, CompilerException):
Note: See TracChangeset for help on using the changeset viewer.