Skip to content

Commit

Permalink
fix: correct assert placement for callback
Browse files Browse the repository at this point in the history
  • Loading branch information
vTuanpham committed Sep 5, 2024
1 parent 757945e commit 4b7b44e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion translator/data_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def __init__(self, file_path: str,
print(f"Parser {self.parser_name} has {len(self.parser_callbacks)} callbacks")
self.parser_callbacks = [callback() for callback in self.parser_callbacks]
for callback in self.parser_callbacks:
assert isinstance(callback, ParserCallback), "Please provide a valid callback function!"
callback.on_start_init(self)

self.data_read = None
Expand Down Expand Up @@ -142,7 +143,6 @@ def __init__(self, file_path: str,

if self.parser_callbacks:
for callback in self.parser_callbacks:
assert isinstance(callback, ParserCallback), "Please provide a valid callback function!"
callback.on_finish_init(self)

@property
Expand Down

0 comments on commit 4b7b44e

Please sign in to comment.