Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _check_error(return_value):
"""Raise IOError if return_value < 0.
The exception will be raised with the error message from PortMidi.
"""
if return_value < 0:
raise IOError(pm.lib.Pm_GetErrorText(return_value))
def _check_error(return_value):
"""Raise IOError if return_value < 0.
The exception will be raised with the error message from PortMidi.
"""
if return_value == pm.pmHostError:
raise IOError('PortMidi Host Error: '
'{}'.format(pm.get_host_error_message()))
elif return_value < 0:
raise IOError(pm.lib.Pm_GetErrorText(return_value))