🔧 chore(validate.py): remove unnecessary contextlib.suppress block
The contextlib.suppress block was suppressing import errors, but it is no longer needed as the import errors are handled elsewhere in the code. Removing this block improves code readability and removes unnecessary complexity.
This commit is contained in:
parent
2815f5a139
commit
93892df805
1 changed files with 3 additions and 2 deletions
|
|
@ -204,8 +204,9 @@ def create_class(code, class_name):
|
|||
code_obj = compile(
|
||||
ast.Module(body=[class_code], type_ignores=[]), "<string>", "exec"
|
||||
)
|
||||
with contextlib.suppress(Exception):
|
||||
exec(code_obj, exec_globals, locals())
|
||||
# This suppresses import errors
|
||||
# with contextlib.suppress(Exception):
|
||||
exec(code_obj, exec_globals, locals())
|
||||
exec_globals[class_name] = locals()[class_name]
|
||||
|
||||
# Return a function that imports necessary modules and creates an instance of the target class
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue