lib/pycall/libpython/finder.rb in pycall-1.3.0.dev vs lib/pycall/libpython/finder.rb in pycall-1.3.0

- old
+ new

@@ -38,14 +38,10 @@ def find_libpython(python = nil) debug_report("find_libpython(#{python.inspect})") python, python_config = find_python_config(python) - set_PYTHONHOME(python_config) - libs = make_libs(python_config) - libpaths = make_libpaths(python_config) - # Try LIBPYTHON environment variable first. if (libpython = ENV['LIBPYTHON']) if File.file?(libpython) begin return dlopen(libpython) @@ -57,10 +53,13 @@ end warn "WARNING(#{self}.#{__method__}) Ignore the wrong libpython location specified in ENV['LIBPYTHON']." end # Find libpython (we hope): + set_PYTHONHOME(python_config) + libs = make_libs(python_config) + libpaths = make_libpaths(python_config) multiarch = python_config[:MULTIARCH] || python_config[:multiarch] libs.each do |lib| libpaths.each do |libpath| libpath_libs = [ File.join(libpath, lib) ] libpath_libs << File.join(libpath, multiarch, lib) if multiarch @@ -119,10 +118,10 @@ def python_investigator_py File.expand_path('../../python/investigator.py', __FILE__) end def set_PYTHONHOME(python_config) - if !ENV.has_key?('PYTHONHOME') && python_config[:conda] + if !ENV.has_key?('PYTHONHOME') case RUBY_PLATFORM when /mingw32/, /cygwin/, /mswin/ ENV['PYTHONHOME'] = python_config[:exec_prefix] else ENV['PYTHONHOME'] = python_config.values_at(:prefix, :exec_prefix).join(':')