File: remove-distutils.patch

package info (click to toggle)
importmagic 0.1.7-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,296 kB
  • sloc: python: 5,816; makefile: 5
file content (30 lines) | stat: -rw-r--r-- 1,220 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
Author: Diane Trout <diane@ghic.org>
Description: Replace distutils.sysconfig with it's closest sysconfig alternatives
Forwarded: https://github.com/alecthomas/importmagic/issues/67

--- a/importmagic/index.py
+++ b/importmagic/index.py
@@ -8,18 +8,16 @@
 import logging
 import re
 from contextlib import contextmanager
-from distutils import sysconfig
+import sysconfig
 
 from importmagic.util import parse_ast
 
 
 LIB_LOCATIONS = sorted(set((
-    (sysconfig.get_python_lib(standard_lib=True), 'S'),
-    (sysconfig.get_python_lib(plat_specific=True), '3'),
-    (sysconfig.get_python_lib(standard_lib=True, prefix=sys.prefix), 'S'),
-    (sysconfig.get_python_lib(plat_specific=True, prefix=sys.prefix), '3'),
-    (sysconfig.get_python_lib(standard_lib=True, prefix='/usr/local'), 'S'),
-    (sysconfig.get_python_lib(plat_specific=True, prefix='/usr/local'), '3'),
+    (sysconfig.get_path('stdlib', scheme='deb_system'), 'S'),
+    (sysconfig.get_path('platlib', scheme='deb_system'), '3'),
+    (sysconfig.get_path('stdlib', scheme='posix_local'), 'S'),
+    (sysconfig.get_path('platlib', scheme='posix_local'), '3'),
 )), key=lambda l: -len(l[0]))
 
 # Regex matching modules that we never attempt to index.