Skip to content

Commit c2587a9

Browse files
committed
fixed higher-level again
1 parent 9373970 commit c2587a9

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

misc/force-version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.12-dev:::2024-10-31_11:57:59
1+
3.7.12-dev:::2024-11-28_07:52:29

src/modules/higher-level/py-udf-hl.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ int date_from_bandname(date_t *date, char *bandname);
6161
--- phl: HL parameters
6262
+++ Return: void
6363
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++**/
64-
void register_python(par_hl_t *phl){
64+
int register_python(par_hl_t *phl){
6565
par_udf_t *udf;
6666

6767

@@ -75,17 +75,12 @@ par_udf_t *udf;
7575
} else if (phl->udf.pyp.out){
7676
udf = &phl->udf.pyp;
7777
} else {
78-
exit(FAILURE);
78+
return(CANCEL);
7979
}
8080

81-
8281
Py_Initialize();
8382

84-
if (_import_array() < 0) {
85-
PyErr_Print();
86-
PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import");
87-
exit(FAILURE);
88-
}
83+
import_array();
8984

9085
PyRun_SimpleString("from multiprocessing.pool import Pool");
9186
PyRun_SimpleString("import numpy as np");
@@ -185,7 +180,7 @@ par_udf_t *udf;
185180
printf("finished to register python interface\n");
186181
#endif
187182

188-
return;
183+
return SUCCESS;
189184
}
190185

191186

src/modules/higher-level/py-udf-hl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Python UDF plug-in header
3939
extern "C" {
4040
#endif
4141

42-
void register_python(par_hl_t *phl);
42+
int register_python(par_hl_t *phl);
4343
void deregister_python(par_hl_t *phl);
4444
void init_pyp(ard_t *ard, tsa_t *ts, int submodule, char *idx_name, int nb, int nt, par_udf_t *udf);
4545
void term_pyp(par_udf_t *udf);

0 commit comments

Comments
 (0)