File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
src/main/scala/ai/kien/python Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ class Python private[python] (
9999 val l = for {
100100 elem <- path.split(pathSeparator).iterator
101101 elemPath = fs.getPath(elem)
102- ext <- pathExts.iterator
102+ ext <- pathExts.iterator
103103 } yield Files .exists(elemPath.resolve(exec + ext))
104104
105105 l.contains(true )
@@ -192,13 +192,21 @@ object Python {
192192 private def executableCmd = " import sys;print(sys.executable)"
193193
194194 private def ldversionCmd =
195- " import sys,sysconfig;print(sysconfig.get_python_version() + sys.abiflags)"
196-
197- private def libPathCmd = Seq (
198- " import sys" ,
199- " import os.path" ,
200- " from sysconfig import get_config_var" ,
201- " print(get_config_var('LIBPL') + ';')" ,
202- " print(os.path.join(sys.base_prefix, 'lib'))"
203- ).mkString(" ;" )
195+ """ import sys
196+ |import sysconfig
197+ |try:
198+ | abiflags = sys.abiflags
199+ |except AttributeError:
200+ | abiflags = ''
201+ |print(sysconfig.get_python_version() + abiflags)
202+ """ .stripMargin
203+
204+ private def libPathCmd =
205+ """ import sys
206+ |import os.path
207+ |from sysconfig import get_config_var
208+ |libpl = get_config_var('LIBPL')
209+ |libpl = libpl + ';' if libpl is not None else ''
210+ |print(libpl + os.path.join(sys.base_prefix, 'lib'))
211+ """ .stripMargin
204212}
You can’t perform that action at this time.
0 commit comments