don't crash if unit is not found
This commit is contained in:
parent
8b274bfa60
commit
dc15310118
1 changed files with 1 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ def get_bytes_size(size, unit_name):
|
||||||
'GB': 1024 * 1024 * 1024,
|
'GB': 1024 * 1024 * 1024,
|
||||||
'TB': 1024 * 1024 * 1024 * 1024,
|
'TB': 1024 * 1024 * 1024 * 1024,
|
||||||
}
|
}
|
||||||
return float(size * unit_data[unit_name])
|
return float(size * unit_data.get(unit_name, 1))
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue