From 1f722d68bc65122de955e08365f663ad4f1c2f57 Mon Sep 17 00:00:00 2001 From: shihangan Date: Mon, 20 Jul 2026 10:39:51 -0500 Subject: [PATCH] Fix TypeError with yapf>=0.32 during config formatting The 'verify' parameter was removed in yapf 0.32.0, causing training to crash immediately with: TypeError: FormatCode() got an unexpected keyword argument 'verify' This commit adds a try-except fallback to support both old (<0.32) and new (>=0.32) yapf versions. Tested on: - yapf 0.31.0 (old): verify=True works - yapf 0.40.2 (new): falls back to no verify parameter --- util/slconfig.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/slconfig.py b/util/slconfig.py index 80647275..139161ac 100644 --- a/util/slconfig.py +++ b/util/slconfig.py @@ -314,7 +314,11 @@ def _format_dict(input_dict, outest_level=False): based_on_style='pep8', blank_line_before_nested_class_or_def=True, split_before_expression_after_opening_paren=True) - text, _ = FormatCode(text, style_config=yapf_style, verify=True) + try: + text, _ = FormatCode(text, style_config=yapf_style, verify=True) + except TypeError: + # yapf >= 0.32 removed the 'verify' parameter + text, _ = FormatCode(text, style_config=yapf_style) return text