FMPy icon indicating copy to clipboard operation
FMPy copied to clipboard

TypeError in ssp-simulate

Open beutlich opened this issue 2 years ago • 0 comments

On Python 3.7, python -m fmpy.ssp.simulate Example_eDrive.ssp fails with

Traceback (most recent call last):
  File "C:\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Projekte\FMPy_Test\.venv\lib\site-packages\fmpy\ssp\simulate.py", line 27, in <module>
    result = simulate_ssp(args.ssp_filename, stop_time=args.stop_time)
  File "C:\Projekte\FMPy_Test\.venv\lib\site-packages\fmpy\ssp\simulation.py", line 155, in simulate_ssp
    connections = get_connections(ssd.system)
  File "C:\Projekte\FMPy_Test\.venv\lib\site-packages\fmpy\ssp\ssd.py", line 715, in get_connections
    cons += get_connections(element, connectors=connectors)
  File "C:\Projekte\FMPy_Test\.venv\lib\site-packages\fmpy\ssp\ssd.py", line 682, in get_connections
    end_p = build_path(system) + '.' + connection.startElement + '.' + connection.startConnector
TypeError: can only concatenate str (not "NoneType") to str

because it is illegal to concatenate str and NoneType in https://github.com/CATIA-Systems/FMPy/blob/b84238dcfa416e14694fc6b3650347208033dc0d/fmpy/ssp/ssd.py#L682

Should it be

                    end_p = build_path(system) + '.' + connection.endElement + '.' + connection.endConnector

?

beutlich avatar Mar 14 '23 15:03 beutlich