Skip to content

Commit

Permalink
Add flush
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex committed Jun 21, 2023
1 parent 5cc2c30 commit 595d53c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bump_pydantic/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def main(
color_diff(console, error_msg)
else:
log_fp.writelines(error_msg)
log_fp.flush()

modified = [Path(f) for f in files if os.stat(f).st_mtime > start_time]
if modified:
Expand All @@ -108,9 +109,9 @@ def visit_class_def(metadata_manager: FullRepoManager, package: str, filename: s
return context.scratch


def capture_exception(func: Callable[P, T]) -> Callable[P, T | str]:
def capture_exception(func: Callable[P, T]) -> Callable[P, Union[T, str]]:
@functools.wraps(func)
def wrapper(*args: P.args, **kwargs: P.kwargs) -> T | str:
def wrapper(*args: P.args, **kwargs: P.kwargs) -> Union[T, str]:
try:
return func(*args, **kwargs)
except Exception as exc:
Expand Down

0 comments on commit 595d53c

Please sign in to comment.