File: setuptools-60

package info (click to toggle)
cppimport 22.08.02-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 260 kB
  • sloc: python: 756; cpp: 71; ansic: 31; sh: 8; makefile: 3
file content (39 lines) | stat: -rw-r--r-- 1,128 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: Stefano Rivera <stefanor@debian.org>
Date: Thu, 29 Sep 2022 12:40:42 +0200
Subject: Import distutils after setuptools

distutils is being removed from Python in 3.12. To prepare for this,
setuptools now bundles its own copy of distutils, which it
patches into sys.path, by default, since setuptools 60.

https://setuptools.pypa.io/en/latest/history.html#v60-0-0

To avoid importing two different distutils, import setuptools before
distutils.

Forwarded: https://github.com/tbenthompson/cppimport/pull/84
Bug-Debian: https://bugs.debian.org/1020571
---
 cppimport/build_module.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cppimport/build_module.py b/cppimport/build_module.py
index 15f81b7..5414439 100644
--- a/cppimport/build_module.py
+++ b/cppimport/build_module.py
@@ -1,6 +1,4 @@
 import contextlib
-import distutils
-import distutils.sysconfig
 import io
 import logging
 import os
@@ -9,6 +7,8 @@ import tempfile
 
 import setuptools
 import setuptools.command.build_ext
+import distutils
+import distutils.sysconfig
 
 import cppimport
 from cppimport.filepaths import make_absolute