Skip to content

Commit 92c795c

Browse files
committed
fix: replace bare except with except Exception in analysis.py
Bare except clauses catch SystemExit and KeyboardInterrupt which prevents clean process termination. Use except Exception per PEP 8.
1 parent 8fbf6c4 commit 92c795c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

skills/datanalysis-credit-risk/references/analysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ def _calc_single_psi(args):
483483
# Bin based on non-NaN data (10 bins)
484484
try:
485485
bins = pd.qcut(train_nonan, q=10, duplicates='drop', retbins=True)[1]
486-
except:
486+
except Exception:
487487
bins = pd.cut(train_nonan, bins=10, retbins=True)[1]
488488

489489
# Calculate proportion of each bin (including NaN bin)
@@ -996,7 +996,7 @@ def export_cleaning_report(filepath: str, steps: list,
996996

997997
try:
998998
wb = load_workbook(filepath)
999-
except:
999+
except Exception:
10001000
wb = Workbook()
10011001
wb.remove(wb.active)
10021002

0 commit comments

Comments
 (0)