|
27 | 27 |
|
28 | 28 | import static com.oracle.graal.python.nodes.SpecialMethodNames.__ITER__;
|
29 | 29 | import static com.oracle.graal.python.nodes.SpecialMethodNames.__NEXT__;
|
30 |
| -import static com.oracle.graal.python.runtime.exception.PythonErrorType.NotImplementedError; |
31 | 30 | import static com.oracle.graal.python.runtime.exception.PythonErrorType.StopIteration;
|
32 | 31 | import static com.oracle.graal.python.runtime.exception.PythonErrorType.TypeError;
|
33 | 32 |
|
|
48 | 47 | import com.oracle.graal.python.nodes.function.builtins.PythonUnaryBuiltinNode;
|
49 | 48 | import com.oracle.graal.python.runtime.exception.PException;
|
50 | 49 | import com.oracle.truffle.api.dsl.Cached;
|
51 |
| -import com.oracle.truffle.api.dsl.Fallback; |
52 | 50 | import com.oracle.truffle.api.dsl.GenerateNodeFactory;
|
53 | 51 | import com.oracle.truffle.api.dsl.NodeFactory;
|
54 | 52 | import com.oracle.truffle.api.dsl.Specialization;
|
@@ -176,18 +174,12 @@ Object sendThrow(PGenerator self, @SuppressWarnings("unused") PythonClass typ, P
|
176 | 174 | }
|
177 | 175 | }
|
178 | 176 |
|
179 |
| - @Builtin(name = "gi_code", minNumOfArguments = 1, maxNumOfArguments = 2, isGetter = true, isSetter = true) |
| 177 | + @Builtin(name = "gi_code", fixedNumOfArguments = 1, isGetter = true) |
180 | 178 | @GenerateNodeFactory
|
181 | 179 | public abstract static class GetCodeNode extends PythonBuiltinNode {
|
182 |
| - @Specialization(guards = {"isNoValue(none)"}) |
183 |
| - Object getCode(PGenerator self, @SuppressWarnings("unused") PNone none) { |
| 180 | + @Specialization |
| 181 | + Object getCode(PGenerator self) { |
184 | 182 | return factory().createCode(self.getGeneratorRootNode());
|
185 | 183 | }
|
186 |
| - |
187 |
| - @SuppressWarnings("unused") |
188 |
| - @Fallback |
189 |
| - Object setCode(Object self, Object code) { |
190 |
| - throw raise(NotImplementedError, "setting gi_code"); |
191 |
| - } |
192 | 184 | }
|
193 | 185 | }
|
0 commit comments