File: Replace-find_executable-not-existing-anymore-with-shutil..patch

package info (click to toggle)
python-pyds9 1.8.1-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid, trixie
  • size: 4,224 kB
  • sloc: ansic: 17,257; sh: 3,668; python: 701; makefile: 491; tcl: 219
file content (32 lines) | stat: -rw-r--r-- 1,030 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
32
From: Ole Streicher <olebole@debian.org>
Date: Mon, 17 Dec 2018 16:37:09 +0100
Subject: Replace find_executable (not existing anymore) with shutil.which

---
 pyds9.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pyds9.py b/pyds9.py
index bd9393a..fb2dbb2 100644
--- a/pyds9.py
+++ b/pyds9.py
@@ -2,7 +2,7 @@ from __future__ import (print_function, absolute_import, division,
                         unicode_literals)
 
 import contextlib
-from distutils.spawn import find_executable
+import shutil
 import sys
 import subprocess
 import shlex
@@ -59,8 +59,8 @@ def get_xpans_ds9():
     xpans_path = os.pathsep.join([pyds9_dir, xpa_dir, xpans_path])
 
     # find the executables
-    xpans = find_executable('xpans', path=xpans_path)
-    ds9 = [find_executable('ds9')]
+    xpans = shutil.which('xpans', path=xpans_path)
+    ds9 = [shutil.which('ds9')]
 
     # warning message in case ds9 and/or xpans is not found
     ds9_warning = ("Can't locate DS9 executable. Please add the DS9 directory"