mirror of
https://github.com/ROCm/jax.git
synced 2025-04-19 05:16:06 +00:00
Avoid using os.linesep
This commit is contained in:
parent
48ad9a6f3e
commit
7b8bdfbe0f
@ -41,6 +41,9 @@ def _typecheck_param(prim, param, name, msg_required, pred):
|
||||
msg = (f'invalid {prim} param {name} of type {type(param).__name__}, '
|
||||
f'{msg_required} required:')
|
||||
param_str = str(param)
|
||||
# Avoid using os.linesep here to have the same multi-line error message
|
||||
# format on different platforms.
|
||||
sep = '\n' if '\n' in param_str or '\r' in param_str else ' '
|
||||
sep = os.linesep if os.linesep in param_str else ' '
|
||||
msg = sep.join([msg, param_str])
|
||||
raise core.JaxprTypeError(msg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user