From 091c977f037d3ae23770a3c5b6ac837f77520c2f Mon Sep 17 00:00:00 2001 From: eclipse Date: Fri, 18 Jul 2025 23:35:05 +0200 Subject: [PATCH] fixed a bug --- the_works/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/the_works/__init__.py b/the_works/__init__.py index daea846..0a6eb31 100644 --- a/the_works/__init__.py +++ b/the_works/__init__.py @@ -50,8 +50,8 @@ def create_app(config=None): # helper function to print formatted file size; [source](https://stackoverflow.com/a/1094933) -def sizeof_fmt(num: int, suffix: str = "B") -> str: - if type(num) == "String": +def sizeof_fmt(num: int | str, suffix: str = "B") -> str: + if type(num) == str: num = int(num) for unit in ("", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi"): if abs(num) < 1024.0: