Mercurial > p > roundup > code
diff roundup/admin.py @ 6001:3719b01cbe9e
BANDIT reports assert. Replace assert with raise.
Assert used but it can be removed from optimized code.
The check looks like it is required. So raise an AssertionFailure.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 26 Dec 2019 21:17:48 -0500 |
| parents | 33a7b10618a6 |
| children | d25638d1826c |
line wrap: on
line diff
--- a/roundup/admin.py Thu Dec 26 21:16:10 2019 -0500 +++ b/roundup/admin.py Thu Dec 26 21:17:48 2019 -0500 @@ -1228,7 +1228,8 @@ # for a safe upper bound of field length we add # difference between CSV len and sum of all field lengths d = sum ([len(x) for x in exp]) - lensum - assert (d > 0) + if not d > 0: + raise AssertionError("Bad assertion d > 0") for p in propnames: ll = len(repr_export(node[p])) + d if ll > max_len:
