Skip to content

Commit aa4d9e2

Browse files
committed
[hotfix] enable set function code
PullRequest: graalpython/364
2 parents d7b367c + 61e3b30 commit aa4d9e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/function/AbstractFunctionBuiltins.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2018, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2019, Oracle and/or its affiliates.
33
* Copyright (c) 2014, Regents of the University of California
44
*
55
* All rights reserved.
@@ -36,7 +36,6 @@
3636
import static com.oracle.graal.python.nodes.SpecialMethodNames.__CALL__;
3737
import static com.oracle.graal.python.nodes.SpecialMethodNames.__GET__;
3838
import static com.oracle.graal.python.runtime.exception.PythonErrorType.AttributeError;
39-
import static com.oracle.graal.python.runtime.exception.PythonErrorType.NotImplementedError;
4039

4140
import java.util.List;
4241

@@ -250,7 +249,8 @@ Object getCode(PFunction self, @SuppressWarnings("unused") PNone none,
250249
@SuppressWarnings("unused")
251250
@Specialization(guards = "!isBuiltinFunction(self)")
252251
Object setCode(PFunction self, PCode code) {
253-
throw raise(NotImplementedError, "setting __code__");
252+
self.setCode(code);
253+
return PNone.NONE;
254254
}
255255

256256
@SuppressWarnings("unused")

0 commit comments

Comments
 (0)