From a0d5fc6b76f27fc4aabc027789cfc9bf9a467a21 Mon Sep 17 00:00:00 2001 From: Mathieu Dupuy Date: Wed, 12 Jul 2023 18:16:09 +0200 Subject: [PATCH] Update asserts.py documentation (#1036) it's been a while Python does not produce anymore .pyo files (see https://docs.python.org/3/using/cmdline.html#cmdoption-O) --- bandit/plugins/asserts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bandit/plugins/asserts.py b/bandit/plugins/asserts.py index 346b43c76..b32007c65 100644 --- a/bandit/plugins/asserts.py +++ b/bandit/plugins/asserts.py @@ -9,8 +9,8 @@ This plugin test checks for the use of the Python ``assert`` keyword. It was discovered that some projects used assert to enforce interface constraints. -However, assert is removed with compiling to optimised byte code (python -o -producing \*.pyo files). This caused various protections to be removed. +However, assert is removed with compiling to optimised byte code (`python -O` +producing \*.opt-1.pyc files). This caused various protections to be removed. Consider raising a semantically meaningful error or ``AssertionError`` instead. Please see