[BE] Fix all B022 useless-contextlib-suppress (#100335)

No arguments passed to contextlib.suppress. No exceptions will be suppressed and therefore this context manager is redundant

Pull Request resolved: https://github.com/pytorch/pytorch/pull/100335
Approved by: https://github.com/Skylion007
This commit is contained in:
Justin Chu
2023-04-30 08:57:15 -07:00
committed by PyTorch MergeBot
parent d7bdfd3454
commit 01abbfbaae
18 changed files with 38 additions and 39 deletions

View File

@ -916,7 +916,7 @@ def _get_should_profile():
def _enable_rpc_profiler(should_profile, qualified_name, func, rpc_type, dst_worker_info):
ctx_manager = contextlib.suppress()
ctx_manager = contextlib.nullcontext()
if should_profile:
# Create appropriate string representation based on type of func