Skip to content

Commit fc76c0b

Browse files
authored
Merge pull request #100 from rmatsumiya/master
Modify PYTHONHOME configuration not to depend on anaconda version fix #99
2 parents f7ec9f8 + d93fe8a commit fc76c0b

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

lib/pycall/libpython/finder.rb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ def find_libpython(python = nil)
4040
debug_report("find_libpython(#{python.inspect})")
4141
python, python_config = find_python_config(python)
4242

43-
set_PYTHONHOME(python_config)
44-
libs = make_libs(python_config)
45-
libpaths = make_libpaths(python_config)
46-
4743
# Try LIBPYTHON environment variable first.
4844
if (libpython = ENV['LIBPYTHON'])
4945
if File.file?(libpython)
@@ -59,6 +55,9 @@ def find_libpython(python = nil)
5955
end
6056

6157
# Find libpython (we hope):
58+
set_PYTHONHOME(python_config)
59+
libs = make_libs(python_config)
60+
libpaths = make_libpaths(python_config)
6261
multiarch = python_config[:MULTIARCH] || python_config[:multiarch]
6362
libs.each do |lib|
6463
libpaths.each do |libpath|
@@ -121,7 +120,7 @@ def python_investigator_py
121120
end
122121

123122
def set_PYTHONHOME(python_config)
124-
if !ENV.has_key?('PYTHONHOME') && python_config[:conda]
123+
if !ENV.has_key?('PYTHONHOME')
125124
case RUBY_PLATFORM
126125
when /mingw32/, /cygwin/, /mswin/
127126
ENV['PYTHONHOME'] = python_config[:exec_prefix]

lib/pycall/python/investigator.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
from distutils.sysconfig import get_config_var
22
import sys
33

4-
def conda():
5-
return 'conda' in sys.version or 'Continuum' in sys.version
6-
74
for var in ('executable', 'exec_prefix', 'prefix'):
85
print(var + ': ' + str(getattr(sys, var)))
9-
print('conda: ' + ('true' if conda() else 'false'))
106
print('multiarch: ' + str(getattr(getattr(sys, 'implementation', sys), '_multiarch', None)))
117
for var in ('VERSION', 'INSTSONAME', 'LIBRARY', 'LDLIBRARY', 'LIBDIR', 'PYTHONFRAMEWORKPREFIX', 'MULTIARCH'):
128
print(var + ': ' + str(get_config_var(var)))

0 commit comments

Comments
 (0)