]> gitweb.factorcode.org Git - factor.git/commitdiff
python: Only call the init if python is actually present.
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 19 Feb 2018 16:41:46 +0000 (10:41 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 19 Feb 2018 16:41:46 +0000 (10:41 -0600)
Fixes #1952

extra/python/python.factor

index 88bceafaf5fc6ea80f84168d9391a3e2755f28f4..68e3b4f77607bd858f5b1a7ac96f4a4b95a38af6 100644 (file)
@@ -1,4 +1,5 @@
-USING: alien alien.c-types alien.data arrays assocs command-line fry
+USING: alien alien.c-types alien.data alien.libraries
+arrays assocs command-line fry
 hashtables init io.encodings.utf8 kernel namespaces
 python.errors python.ffi python.objects sequences
 specialized-arrays strings vectors ;
@@ -115,5 +116,5 @@ ERROR: missing-type type ;
 : with-quot>py-cfunction ( alien quot -- )
     '[ <py-cfunction> @ ] with-callback ; inline
 
-[ py-initialize ] "python" add-startup-hook
+[ "PyIsInitialized" "python2.7" library-dll dlsym? [ py-initialize ] when ] "python" add-startup-hook
 [ py-finalize ] "python" add-shutdown-hook