square / pylink

Python Library for device debugging/programming via J-Link
https://pylink.readthedocs.io/en/latest/
Other
346 stars 127 forks source link

exec_command(f'SetRTTTelnetPort 19021') raises JLinkException when success #171

Open jupe opened 1 year ago

jupe commented 1 year ago

jlink.exec_command(f'SetRTTTelnetPort 19021') seems to raises always JLinkException('RTT Telnet Port set to 19021') even in success case. Tested with latest release.

I expects that success case doesn't raise anything, only failure cases. Workaround is to catch exception and pass it.

hkpeprah commented 1 year ago

Hm. It seems like it the function doesn't expect any output string (read: error string), and raises an exception if there is one. Might not be the best way to go about this, but maybe worth adding a separate new function to capture this use case instead?