Skip to content

Commit 66354df

Browse files
authored
Merge pull request #135 from jmarrec/121_Py_initialize
#121 - Revert "Remove conda checking"
2 parents dd1cf50 + aeb97e9 commit 66354df

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/pycall/libpython/finder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def python_investigator_py
120120
end
121121

122122
def set_PYTHONHOME(python_config)
123-
if !ENV.has_key?('PYTHONHOME')
123+
if !ENV.has_key?('PYTHONHOME') && python_config[:conda]
124124
case RUBY_PLATFORM
125125
when /mingw32/, /cygwin/, /mswin/
126126
ENV['PYTHONHOME'] = python_config[:exec_prefix]

lib/pycall/python/investigator.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
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+
47
for var in ('executable', 'exec_prefix', 'prefix'):
58
print(var + ': ' + str(getattr(sys, var)))
9+
print('conda: ' + ('true' if conda() else 'false'))
610
print('multiarch: ' + str(getattr(getattr(sys, 'implementation', sys), '_multiarch', None)))
711
for var in ('VERSION', 'INSTSONAME', 'LIBRARY', 'LDLIBRARY', 'LIBDIR', 'PYTHONFRAMEWORKPREFIX', 'MULTIARCH'):
812
print(var + ': ' + str(get_config_var(var)))

0 commit comments

Comments
 (0)