From 9c1e2c59e3892b7b58ef8a842cb84f95c5bb27e1 Mon Sep 17 00:00:00 2001 From: harshadkhetpal Date: Mon, 23 Mar 2026 10:12:52 +0530 Subject: [PATCH] fix: use except Exception and is not None in data_selection/utils.py Two PEP8/correctness fixes: 1. Replace bare `except:` with `except Exception:` on import guard 2. Replace `!= None` comparison with `is not None` (PEP8 E711) --- data_selection/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data_selection/utils.py b/data_selection/utils.py index 0b797d8f..6b99794a 100644 --- a/data_selection/utils.py +++ b/data_selection/utils.py @@ -12,7 +12,7 @@ try: from transformers import mpu -except: +except Exception: mpu = None WANDB_PROJ_NAME = "data_selection" @@ -115,7 +115,7 @@ def initialize(args, do_distributed=True): set_random_seed(args.seed, args.model_parallel) # init save folder - if args.save != None: + if args.save is not None: os.makedirs(args.save, exist_ok=True)