Skip to content

Commit acdbde2

Browse files
committed
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.
1 parent 4a70449 commit acdbde2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

roundup/admin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,8 @@ class colon_separated(csv.excel):
12281228
# for a safe upper bound of field length we add
12291229
# difference between CSV len and sum of all field lengths
12301230
d = sum ([len(x) for x in exp]) - lensum
1231-
assert (d > 0)
1231+
if not d > 0:
1232+
raise AssertionError("Bad assertion d > 0")
12321233
for p in propnames:
12331234
ll = len(repr_export(node[p])) + d
12341235
if ll > max_len:

0 commit comments

Comments
 (0)