Explorar el Código

More robust command check

Use shutil.which instead of subprocess.call()
pull/559/head
Elie KADOCHE hace 4 años
committed by Guillaume Vincent
padre
commit
4ac0105a66
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. +2
    -1
      cli/lesspass/clipboard.py

+ 2
- 1
cli/lesspass/clipboard.py Ver fichero

@@ -1,5 +1,6 @@
import os
import platform
import shutil
import subprocess
import uuid

@@ -11,7 +12,7 @@ def _call(args):
def _copy_available(command):
if platform.system() == "Windows":
return _call(["where", command]) == 0
return _call(["which", command]) == 0
return shutil.which(command) is not None


def get_system_copy_command():


Cargando…
Cancelar
Guardar