The generateCatch/generateCatchBlock functions weren't taking into account the function specific HoldGIL setting, resulting in a compile error:
error: ‘_save’ was not declared in this scope This simple patch fixes the problem. Matt
diff -r 76a18a32f759 sipgen/gencode.c --- a/sipgen/gencode.c Sat Sep 29 12:26:43 2012 +0100 +++ b/sipgen/gencode.c Tue Nov 06 14:33:01 2012 -0800 @@ -203,9 +203,9 @@ int secCall, FILE *fp); static void generateTry(throwArgs *, FILE *); static void generateCatch(throwArgs *ta, signatureDef *sd, moduleDef *mod, - FILE *fp); + FILE *fp, int rgil); static void generateCatchBlock(moduleDef *mod, exceptionDef *xd, - signatureDef *sd, FILE *fp); + signatureDef *sd, FILE *fp, int rgil); static void generateThrowSpecifier(throwArgs *, FILE *); static void generateSlot(moduleDef *mod, classDef *cd, enumDef *ed, memberDef *md, FILE *fp); @@ -10578,7 +10578,7 @@ * Generate the catch blocks for a call. */ static void generateCatch(throwArgs *ta, signatureDef *sd, moduleDef *mod, - FILE *fp) + FILE *fp, int rgil) { /* * Generate the block if there was no throw specifier, or a non-empty @@ -10595,11 +10595,11 @@ int a; for (a = 0; a < ta->nrArgs; ++a) - generateCatchBlock(mod, ta->args[a], sd, fp); + generateCatchBlock(mod, ta->args[a], sd, fp, rgil); } else if (mod->defexception != NULL) { - generateCatchBlock(mod, mod->defexception, sd, fp); + generateCatchBlock(mod, mod->defexception, sd, fp, rgil); } prcode(fp, @@ -10607,7 +10607,7 @@ " {\n" ); - if (release_gil) + if (rgil) prcode(fp, " Py_BLOCK_THREADS\n" "\n" @@ -10629,7 +10629,7 @@ * Generate a single catch block. */ static void generateCatchBlock(moduleDef *mod, exceptionDef *xd, - signatureDef *sd, FILE *fp) + signatureDef *sd, FILE *fp, int rgil) { scopedNameDef *ename = xd->iff->fqcname; @@ -10638,7 +10638,7 @@ " {\n" ,ename,(xd->cd != NULL || usedInCode(xd->raisecode, "sipExceptionRef")) ? "sipExceptionRef" : ""); - if (release_gil) + if (rgil) prcode(fp, "\n" " Py_BLOCK_THREADS\n" @@ -10774,7 +10774,7 @@ prcode(fp,");\n" ); - generateCatch(ct->exceptions, &ct->pysig, mod, fp); + generateCatch(ct->exceptions, &ct->pysig, mod, fp, rgil); if (rgil) prcode(fp, @@ -12252,7 +12252,7 @@ prcode(fp,";\n" ); - generateCatch(od->exceptions, &od->pysig, mod, fp); + generateCatch(od->exceptions, &od->pysig, mod, fp, rgil); if (rgil) prcode(fp,
_______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt