Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Mar 16, 2024
1 parent 7d25ef6 commit f7d2d80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/core/utils/module_import_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ def load_single_subclass_from_source(
subclasses = get_subclasses(module, parent_type)
subclasses_num = len(subclasses)
match subclasses_num:
case 0:
raise Exception(f"Missing subclass of {parent_type.__name__} in {script_path}")
case 1:
return subclasses[0]
case 0:
raise Exception(f"Missing subclass of {parent_type.__name__} in {script_path}")
case _:
raise Exception(f"Multiple subclasses of {parent_type.__name__} in {script_path}")

0 comments on commit f7d2d80

Please sign in to comment.