8000 Changed the evaluated type of an exception group from `ExceptionGroup… · sourcegraph/scip-python@44199ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 44199ee

Browse files
committed
Changed the evaluated type of an exception group from ExceptionGroup to BaseExceptionGroup. This addresses microsoft/pylance-release#4183.
1 parent 15b47ae commit 44199ee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/pyright-internal/src/analyzer/typeEvaluator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18667,9 +18667,9 @@ export function createTypeEvaluator(importLookup: ImportLookup, evaluatorOptions
1866718667
return getExceptionType(subType, node.typeExpression!);
1866818668
});
1866918669

18670-
// If this is an except group, wrap the exception type in an ExceptionGroup.
18670+
// If this is an except group, wrap the exception type in an BaseExceptionGroup.
1867118671
if (node.isExceptGroup) {
18672-
targetType = getBuiltInObject(node, 'ExceptionGroup', [targetType]);
18672+
targetType = getBuiltInObject(node, 'BaseExceptionGroup', [targetType]);
1867318673
}
1867418674

1867518675
if (node.name) {

packages/pyright-internal/src/tests/samples/tryExcept7.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def func1():
99

1010
# This should generate an error if using Python 3.10 or earlier.
1111
except* ValueError as e:
12-
reveal_type(e, expected_text="ExceptionGroup[ValueError]")
12+
reveal_type(e, expected_text="BaseExceptionGroup[ValueError]")
1313
pass
1414

1515
# This should generate an error if using Python 3.10 or earlier.

0 commit comments

Comments
 (0)
0