On 29.09.2025 14:07, Anthony PERARD wrote:
> @@ -352,6 +376,86 @@ def get_default_expr(f, nparent, fexpr):
>  
>      return "%s" % fexpr
>  
> +# For json-c gen_json functions
> +def libxl_C_type_gen_jso(ty, v, indent = "    ", parent = None, scope_object 
> = "jso"):
> +    s = ""
> +    if parent is None:
> +        s += "json_object *jso;\n"
> +        s += "int rc;\n"
> +        sub_scope_object = "jso_sub_1"
> +    else:
> +        sub_scope_object = "jso_sub_%d" % 
> (1+int(scope_object.removeprefix("jso_sub_")))

removeprefix() was added only in 3.9. I'm now trying to figure out what to 
replace
its use with to be compatible with older versions.

Jan

Reply via email to