Skip to content

Commit ccac54b

Browse files
Update compliant01.py
Added: # TODO: input sanitation. # TODO: proper exception handling Into the "add_to_package" function Signed-off-by: Bartlomiej Karas <[email protected]>
1 parent 524055b commit ccac54b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-754/compliant01.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def __init__(self) -> None:
1616

1717
def add_to_package(self, object_weight: Union[str, int, float]) -> None:
1818
"""Add an object into the package after validating its weight."""
19+
# TODO: input sanitation.
20+
# TODO: proper exception handling
1921
try:
2022
value = float(object_weight)
2123
except (ValueError, TypeError) as e:

0 commit comments

Comments
 (0)