Skip to content

Commit 64471af

Browse files
authored
Merge pull request #1996 from sscherfke/patch-1
Remove allways-true if-Statements
2 parents 7edd619 + 27b4ae2 commit 64471af

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

rich/traceback.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,8 @@ def safe_str(_object: Any) -> str:
390390
exc_type = cause.__class__
391391
exc_value = cause
392392
traceback = cause.__traceback__
393-
if traceback:
394-
is_cause = True
395-
continue
393+
is_cause = True
394+
continue
396395

397396
cause = exc_value.__context__
398397
if (
@@ -403,9 +402,8 @@ def safe_str(_object: Any) -> str:
403402
exc_type = cause.__class__
404403
exc_value = cause
405404
traceback = cause.__traceback__
406-
if traceback:
407-
is_cause = False
408-
continue
405+
is_cause = False
406+
continue
409407
# No cover, code is reached but coverage doesn't recognize it.
410408
break # pragma: no cover
411409

0 commit comments

Comments
 (0)