Ensure datahuman is a string if it's not
This commit is contained in:
parent
31254e8174
commit
f4e946c262
|
@ -121,6 +121,9 @@ def format_bytes_tohuman(databytes):
|
|||
|
||||
|
||||
def format_bytes_fromhuman(datahuman):
|
||||
if not isinstance(datahuman, str):
|
||||
datahuman = str(datahuman)
|
||||
|
||||
if not re.search(r"[A-Za-z]+", datahuman):
|
||||
dataunit = "B"
|
||||
datasize = float(datahuman)
|
||||
|
|
Loading…
Reference in New Issue