Skip to content

Commit 81d72da

Browse files
Update docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-252/README.md
Co-authored-by: Bartlomiej Karas <[email protected]> Signed-off-by: Hubert Daniszewski <[email protected]>
1 parent 00997a2 commit 81d72da

File tree

1 file changed

+1
-1
lines changed
  • docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-252

1 file changed

+1
-1
lines changed

docs/Secure-Coding-Guide-for-Python/CWE-703/CWE-252/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ print(my_string)
6262

6363
## Non-Compliant Code Example - Invalid value handling
6464

65-
Return values are also important when they may be used as an alternative to raising exceptions. `str.find()`, unlike `str.index()` return -1 [[Python Docs - str.find](https://docs.python.org/3/library/stdtypes.html#str.find)] instead of raising a `ValueError` [[Python Docs - str.index](https://docs.python.org/3/library/stdtypes.html#str.index)] when it cannot find the given sub-string.
65+
Return values are also important when they may be used as an alternative to raising exceptions. `str.find()`, unlike `str.index()` returns -1 [[Python Docs - str.find](https://docs.python.org/3/library/stdtypes.html#str.find)] instead of raising a `ValueError` [[Python Docs - str.index](https://docs.python.org/3/library/stdtypes.html#str.index)] when it cannot find the given sub-string.
6666
This non-compliant code example shows that using this value will point to the last element of the string regardless of what it is.
6767

6868
*[noncompliant02.py](noncompliant02.py):*

0 commit comments

Comments
 (0)