| 1 |
From: Stefano Rivera <[email protected]> |
| 2 |
Date: Sat, 12 Nov 2022 15:14:59 +0200 |
| 3 |
Subject: Import setuptools before distutils |
| 4 |
|
| 5 |
setuptools 60 uses its own bundled version of distutils, by default. It |
| 6 |
injects this into sys.modules, at import time. So we need to make sure |
| 7 |
that it is imported, before anything else imports distutils, to ensure |
| 8 |
everything is using the same distutils version. |
| 9 |
|
| 10 |
This change in setuptools is to prepare for Python 3.12, which will drop |
| 11 |
distutils. |
| 12 |
|
| 13 |
Forwarded: https://github.com/benoitc/http-parser/pull/97 |
| 14 |
Bug-Debian: https://bugs.debian.org/1022468 |
| 15 |
--- |
| 16 |
setup.py | 8 ++++---- |
| 17 |
1 file changed, 4 insertions(+), 4 deletions(-) |
| 18 |
|
| 19 |
diff --git a/setup.py b/setup.py |
| 20 |
index 5c3f768..5cdd5e1 100644 |
| 21 |
--- a/setup.py |
| 22 |
+++ b/setup.py |
| 23 |
@@ -4,10 +4,6 @@ |
| 24 |
# See the NOTICE for more information. |
| 25 |
|
| 26 |
from __future__ import with_statement |
| 27 |
-from distutils.errors import CCompilerError, DistutilsExecError, \ |
| 28 |
- DistutilsPlatformError |
| 29 |
-from distutils.command.build_ext import build_ext |
| 30 |
-from distutils.command.sdist import sdist as _sdist |
| 31 |
import glob |
| 32 |
from imp import load_source |
| 33 |
import io |
| 34 |
@@ -17,6 +13,10 @@ import sys |
| 35 |
import traceback |
| 36 |
|
| 37 |
from setuptools import setup, find_packages, Extension |
| 38 |
+from distutils.errors import CCompilerError, DistutilsExecError, \ |
| 39 |
+ DistutilsPlatformError |
| 40 |
+from distutils.command.build_ext import build_ext |
| 41 |
+from distutils.command.sdist import sdist as _sdist |
| 42 |
|
| 43 |
if not hasattr(sys, 'version_info') or \ |
| 44 |
sys.version_info < (2, 6, 0, 'final'): |