Skip to content

Commit bd66f63

Browse files
committed
Use nameof for StopAsyncIteration
1 parent 11f525d commit bd66f63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/IronPython/Compiler/Ast/AsyncForStatement.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Threading;
88

99
using IronPython.Runtime.Binding;
10+
using IronPython.Runtime.Exceptions;
1011

1112
using MSAst = System.Linq.Expressions;
1213

@@ -94,7 +95,7 @@ T SetScope<T>(T node) where T : Node {
9495
// except StopAsyncIteration: __running = False
9596
var falseConst = SetScope(new ConstantExpression(false));
9697
var stopRunning = SetScope(new AssignmentStatement([SetScope(new NameExpression(runningName))], falseConst));
97-
var handler = SetScope(new TryStatementHandler(SetScope(new NameExpression("StopAsyncIteration")), null!, SetScope(new SuiteStatement([stopRunning]))));
98+
var handler = SetScope(new TryStatementHandler(SetScope(new NameExpression(nameof(PythonExceptions.StopAsyncIteration))), null!, SetScope(new SuiteStatement([stopRunning]))));
9899
handler.HeaderIndex = span.End;
99100

100101
// try/except/else block

0 commit comments

Comments
 (0)