Skip to content

Commit

Permalink
Improved error message for incorrect exception type in an except cl…
Browse files Browse the repository at this point in the history
…ause. This addresses #9562.
  • Loading branch information
erictraut committed Dec 8, 2024
1 parent 8fe87a9 commit e19106a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/pyright-internal/src/analyzer/typeEvaluator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19510,7 +19510,8 @@ export function createTypeEvaluator(
getTypeOfIterator(
{ type: exceptionType, isIncomplete: exceptionTypeResult.isIncomplete },
/* isAsync */ false,
errorNode
errorNode,
/* emitNotIterableError */ false
)?.type ?? UnknownType.create();

return mapSubtypes(iterableType, (subtype) => {
Expand Down

0 comments on commit e19106a

Please sign in to comment.