File: replace-distutils-find-executable

package info (click to toggle)
valinor 1.1.4%2Bds-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 328 kB
  • sloc: python: 428; makefile: 24; sh: 9
file content (31 lines) | stat: -rw-r--r-- 833 bytes parent folder | download
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
Description: Replace find_executable from distutils (deprecated)
 Replace distutils.spawn.find_executable with shutil.which
Author: Nick Morrott <nickm@debian.org>
Forwarded: not-needed
Last-Update: 2024-02-11
---
--- a/valinor/ide_detection.py
+++ b/valinor/ide_detection.py
@@ -8,7 +8,7 @@
 import logging
 import os
 
-from distutils.spawn import find_executable
+from shutil import which
 
 from project_generator import tools_supported
 from project_generator_definitions.definitions import ProGenDef
@@ -32,11 +32,11 @@
 logger = logging.getLogger('ide_detect')
 
 def _find_generic_gdb():
-    return find_executable('gdb')
+    return which('gdb')
 
 
 def _find_arm_none_eabi_gdb():
-    return find_executable('gdb')
+    return which('gdb')
 
 IDE_Scanners = {
                   'gdb': (_find_generic_gdb, gdb_launcher),