Skip to content

Commit 054d0ef

Browse files
committed
Address review feedback
1 parent 9f89338 commit 054d0ef

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/generator/GeneratorBuiltins.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ private GetTracebackNode ensureGetTracebackNode() {
404404

405405
@Builtin(name = "gi_code", minNumOfPositionalArgs = 1, isGetter = true)
406406
@GenerateNodeFactory
407-
public abstract static class GetCodeNode extends PythonBuiltinNode {
407+
public abstract static class GetCodeNode extends PythonUnaryBuiltinNode {
408408
@Specialization
409409
Object getCode(PGenerator self,
410410
@Cached("createBinaryProfile()") ConditionProfile hasCodeProfile) {
@@ -419,9 +419,9 @@ Object getCode(PGenerator self,
419419

420420
@Builtin(name = "gi_running", minNumOfPositionalArgs = 1, isGetter = true)
421421
@GenerateNodeFactory
422-
public abstract static class GetRunningNode extends PythonBuiltinNode {
422+
public abstract static class GetRunningNode extends PythonUnaryBuiltinNode {
423423
@Specialization
424-
Object getRunning(PGenerator self) {
424+
static Object getRunning(PGenerator self) {
425425
return self.isRunning();
426426
}
427427
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/generator/PGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ public boolean isRunning() {
198198
}
199199

200200
public void setRunning(boolean running) {
201+
assert !running || !this.running : "Attempted to set an already running generator as running";
201202
this.running = running;
202203
}
203204
}

0 commit comments

Comments
 (0)