mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Python code modernization, 5/n (#1165)
* Address raise-missing-from. * Address simplifiable-if-expression. * Address unnecessary-dunder-call. * Address unnecessary-pass. * Address use-list-literal. * Address unused-variable. * Address use-dict-literal.
This commit is contained in:
@@ -420,10 +420,10 @@ def parse_bytes(s):
|
||||
if suffix in units or suffix.isdigit():
|
||||
try:
|
||||
digits = float(digits_part)
|
||||
except ValueError:
|
||||
except ValueError as exc:
|
||||
raise errors.DockerException(
|
||||
f"Failed converting the string value for memory ({digits_part}) to an integer."
|
||||
)
|
||||
) from exc
|
||||
|
||||
# Reconvert to long for the final result
|
||||
s = int(digits * units[suffix])
|
||||
|
||||
Reference in New Issue
Block a user