Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't use distutils if Python version >= 3.10 #8759

Merged
merged 1 commit into from
Jan 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion recipes/boost/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,16 @@ def _get_python_var(self, name):
obtain value of python variable, either by sysconfig, or by distutils.sysconfig
:param name: name of variable to be queried (such as LIBRARY or LDLIBRARY)
:return: value of python sysconfig variable

NOTE: distutils is deprecated and breaks the recipe since Python 3.10
"""
return self._get_python_sc_var(name) or self._get_python_du_var(name)
python_version_parts = self.info.options.python_version.split('.')
python_major = int(python_version_parts[0])
python_minor = int(python_version_parts[1])
if(python_major >= 3 and python_minor >= 10):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good enough (well, it won't work for python 4.0, but okay for today)

return self._get_python_sc_var(name)
else:
return self._get_python_sc_var(name) or self._get_python_du_var(name)

def _detect_python_version(self):
"""
Expand Down