31 lines
1.2 KiB
Diff
31 lines
1.2 KiB
Diff
From 178fa5e11b78cf0900ab4a42a81807858c6a1f15 Mon Sep 17 00:00:00 2001
|
|
From: KumaTea <KumaTea@outlook.com>
|
|
Date: Wed, 1 Sep 2021 18:31:38 +0800
|
|
Subject: [PATCH] `distutils` is deprecated in Python 3.10 #51776
|
|
|
|
The `distutils` is deprecated in Python 3.10.
|
|
|
|
As of #51776, In `python_configure.bzl`, the deprecation message will be printed prior to the include path, causing error on return.
|
|
---
|
|
third_party/py/python_configure.bzl | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/third_party/py/python_configure.bzl b/third_party/py/python_configure.bzl
|
|
index 2f75262ea9f..b41f422e9bd 100644
|
|
--- a/third_party/py/python_configure.bzl
|
|
+++ b/third_party/py/python_configure.bzl
|
|
@@ -155,8 +155,8 @@ def _get_python_include(repository_ctx, python_bin):
|
|
python_bin,
|
|
"-c",
|
|
"from __future__ import print_function;" +
|
|
- "from distutils import sysconfig;" +
|
|
- "print(sysconfig.get_python_inc())",
|
|
+ "import sysconfig;" +
|
|
+ "print(sysconfig.get_path('include'))",
|
|
],
|
|
error_msg = "Problem getting python include path.",
|
|
error_details = ("Is the Python binary path set up right? " +
|
|
--
|
|
2.27.0
|
|
|