Skip to content

Commit 4ea0d84

Browse files
gpsheadclaude
andcommitted
Replace boolean multiplication with explicit 'and' in print_exc_group
The expression need_print_underline *= (i == len(exc.exceptions)) used bool*bool as a substitute for logical and. Replace with a readable conditional. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 16abdaf commit 4ea0d84

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Lib/idlelib/run.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,7 @@ def print_exc_group(typ, exc, tb, prefix=""):
282282
else:
283283
print(f"{prefix2} | <exception {type(sub).__name__} has printed>", file=efile)
284284
need_print_underline = True
285-
need_print_underline *= (i == len(exc.exceptions))
286-
if need_print_underline:
285+
if need_print_underline and i == len(exc.exceptions):
287286
print(f"{prefix2} +------------------------------------", file=efile)
288287

289288
def print_exc(typ, exc, tb, prefix=""):

0 commit comments

Comments
 (0)