summary refs log tree commit diff
path: root/Completion/Redhat
diff options
context:
space:
mode:
authorMalcolm Ramsay <malramsay64@gmail.com>2017-11-10 22:21:20 +1100
committerOliver Kiddle <opk@zsh.org>2017-11-13 21:14:56 +0100
commitd8e3218938381901e5adbc48059fb54a7f12a23b (patch)
tree5236eeb767e2b31314df905504b2447ef530af4f /Completion/Redhat
parent2c00d2132c5f81eee0820fe258b23a6d9f996b7f (diff)
downloadzsh-d8e3218938381901e5adbc48059fb54a7f12a23b.tar.gz
zsh-d8e3218938381901e5adbc48059fb54a7f12a23b.tar.xz
zsh-d8e3218938381901e5adbc48059fb54a7f12a23b.zip
Specify system python in dnf completion
The python executable in the python_exec variable was the python[2|3]
executable found in $PATH. When the python[2|3] executable was not the
system installed version the completion command raised an `ImportError`
as the 'dnf' module was not found.

This commit just completely specifies the python version to be the
system version `/usr/bin/python[2|3]`, allowing completion within a
python dev environment.
Diffstat (limited to 'Completion/Redhat')
-rw-r--r--Completion/Redhat/Command/_dnf4
1 files changed, 2 insertions, 2 deletions
diff --git a/Completion/Redhat/Command/_dnf b/Completion/Redhat/Command/_dnf
index 35b5aa27b..82b9b188f 100644
--- a/Completion/Redhat/Command/_dnf
+++ b/Completion/Redhat/Command/_dnf
@@ -38,9 +38,9 @@ _dnf_local_packages() {
 
 _dnf() {
   if [[ "$(readlink /usr/bin/dnf)" == "dnf-2" ]]; then
-    local python_exec="python2"
+    local python_exec="/usr/bin/python2"
   else
-    local python_exec="python3"
+    local python_exec="/usr/bin/python3"
   fi
   local helper=$(${python_exec} -c "import dnf.cli; print('{}/completion_helper.py'.format(dnf.cli.__path__[0]))")
   local cache_file="/var/cache/dnf/packages.db"