Skip to content

Commit 0f1158a

Browse files
authored
mypy fix (#260)
1 parent ac54977 commit 0f1158a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

udsoncan/connections.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,10 @@ def __init__(self, windll: str, rxid: int, txid: int, name: Optional[str] = None
747747
except OSError as e:
748748
if e.errno in [0x16, 0xe06d7363]:
749749
raise RuntimeError('J2534 Device busy')
750-
raise RuntimeError('%s, %X' % (type(e).__name__, e.errno))
750+
exception_str = type(e).__name__
751+
if e.errno is not None:
752+
exception_str += ', %s' % e.errno
753+
raise RuntimeError(exception_str)
751754

752755
self.log_last_operation("PassThruOpen", with_raise=True)
753756

0 commit comments

Comments
 (0)