Skip to content

Commit 46cc4d4

Browse files
authored
Override reason when SkipTest caught
1 parent 2e88bde commit 46cc4d4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/support/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,9 @@ def has_no_debug_ranges():
546546
def requires_debug_ranges(reason='requires co_positions / debug_ranges'):
547547
try:
548548
skip = has_no_debug_ranges()
549-
except unittest.SkipTest:
549+
except unittest.SkipTest as e:
550550
skip = True
551+
reason = e.args[0] if e.args else reason
551552
return unittest.skipIf(skip, reason)
552553

553554

0 commit comments

Comments
 (0)