mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[1/N] Use "is" in python type comparison (#165037)
It generally recommended to use `is/is not` to compare types. Therefore this series of changes apply this suggestion in the code base, and it aims to finally enabling related linter checks. Pull Request resolved: https://github.com/pytorch/pytorch/pull/165037 Approved by: https://github.com/mlazos
This commit is contained in:
committed by
PyTorch MergeBot
parent
960b0d5f0d
commit
70925bdf82
@ -1432,7 +1432,7 @@ class MultiThreadedTestCase(TestCase):
|
||||
logger.error("Caught exception: \n%s exiting thread %s", msg, rank)
|
||||
error_msg += f"Thread {rank} exited with exception:\n{msg}\n"
|
||||
elif isinstance(exc, SystemExit):
|
||||
if type(exc.code) == int and skip_code < 0:
|
||||
if type(exc.code) is int and skip_code < 0:
|
||||
skip_code = exc.code
|
||||
|
||||
# check exceptions
|
||||
|
Reference in New Issue
Block a user