@@ -3673,30 +3673,29 @@ static Object doGeneric(CApiContext capiContext, ModuleSpec moduleSpec, PythonAb
3673
3673
Object [] cArguments = new Object []{moduleSpecToNativeNode .execute (capiContext , moduleSpec .originalModuleSpec ), moduleDef };
3674
3674
try {
3675
3675
Object result = interopLib .execute (createFunction , cArguments );
3676
- DefaultCheckFunctionResultNode .checkFunctionResult (mName , interopLib .isNull (result ), false , PythonLanguage .get (callGetterNode ), capiContext .getContext (), raiseNode , factory ,
3677
- errOccurredProfile ,
3678
- CREATION_FAILD_WITHOUT_EXCEPTION , CREATION_RAISED_EXCEPTION );
3676
+ DefaultCheckFunctionResultNode .checkFunctionResult (raiseNode , mName , interopLib .isNull (result ), true , PythonLanguage .get (callGetterNode ), capiContext .getContext (),
3677
+ errOccurredProfile , CREATION_FAILD_WITHOUT_EXCEPTION , CREATION_RAISED_EXCEPTION );
3679
3678
module = toJavaNode .execute (capiContext , result );
3680
3679
} catch (UnsupportedTypeException | ArityException | UnsupportedMessageException e ) {
3681
3680
throw CompilerDirectives .shouldNotReachHere ();
3682
3681
}
3683
3682
3684
- /*
3685
- * We are more strict than CPython and require this to be a PythonModule object.
3686
- * This means, if the custom 'create' function uses a native subtype of the
3687
- * module type, then we require it to call our new function.
3688
- */
3689
- if (!(module instanceof PythonModule )) {
3690
- if (mSize > 0 ) {
3691
- throw raiseNode .raise (SystemError , NOT_A_MODULE_OBJECT_BUT_REQUESTS_MODULE_STATE , mName );
3692
- }
3693
- if (hasExecutionSlots ) {
3694
- throw raiseNode .raise (SystemError , "module %s specifies execution slots, but did not create a ModuleType instance" , mName );
3695
- }
3696
- // otherwise CPython is just fine
3697
- } else {
3698
- ((PythonModule ) module ).setNativeModuleDef (moduleDef );
3683
+ /*
3684
+ * We are more strict than CPython and require this to be a PythonModule object.
3685
+ * This means, if the custom 'create' function uses a native subtype of the module
3686
+ * type, then we require it to call our new function.
3687
+ */
3688
+ if (!(module instanceof PythonModule )) {
3689
+ if (mSize > 0 ) {
3690
+ throw raiseNode .raise (SystemError , NOT_A_MODULE_OBJECT_BUT_REQUESTS_MODULE_STATE , mName );
3691
+ }
3692
+ if (hasExecutionSlots ) {
3693
+ throw raiseNode .raise (SystemError , "module %s specifies execution slots, but did not create a ModuleType instance" , mName );
3699
3694
}
3695
+ // otherwise CPython is just fine
3696
+ } else {
3697
+ ((PythonModule ) module ).setNativeModuleDef (moduleDef );
3698
+ }
3700
3699
} else {
3701
3700
PythonModule pythonModule = factory .createPythonModule (mName );
3702
3701
pythonModule .setNativeModuleDef (moduleDef );
@@ -3811,8 +3810,7 @@ static int doGeneric(CApiContext capiContext, PythonModule module, Object module
3811
3810
* and won't ignore this if no error is set. This is then the same
3812
3811
* behaviour if we would have a pointer return type and got 'NULL'.
3813
3812
*/
3814
- DefaultCheckFunctionResultNode .checkFunctionResult (mName , iResult != 0 , false , PythonLanguage .get (callGetterNode ), capiContext .getContext (), raiseNode , factory ,
3815
- errOccurredProfile ,
3813
+ DefaultCheckFunctionResultNode .checkFunctionResult (raiseNode , mName , iResult != 0 , true , PythonLanguage .get (callGetterNode ), capiContext .getContext (), errOccurredProfile ,
3816
3814
EXECUTION_FAILED_WITHOUT_EXCEPTION , EXECUTION_RAISED_EXCEPTION );
3817
3815
break ;
3818
3816
default :
0 commit comments