diff --git a/PackageInfo.g b/PackageInfo.g index e7312fc..17b90ef 100644 --- a/PackageInfo.g +++ b/PackageInfo.g @@ -76,7 +76,7 @@ Dependencies := rec( ), AvailabilityTest := function() - if Filename(DirectoriesPackagePrograms("json"), "json.so") = fail then + if IsKernelExtensionAvailable("json") = false then LogPackageLoadingMessage( PACKAGE_WARNING, [ "kernel functions for json are not available." ] ); return false; diff --git a/init.g b/init.g index 73c3ed8..5f2ccdc 100644 --- a/init.g +++ b/init.g @@ -3,10 +3,9 @@ # # Reading the declaration part of the package. # -_PATH_SO:=Filename(DirectoriesPackagePrograms("json"), "json.so"); -if _PATH_SO <> fail then - LoadDynamicModule(_PATH_SO); + +if LoadKernelExtension("json", "json") = false then + Error("failed to load json kernel extension"); fi; -Unbind(_PATH_SO); ReadPackage( "json", "gap/json.gd");