Browse Source

More robust command check

Use shutil.which instead of subprocess.call()
pull/559/head
Elie KADOCHE 4 years ago
committed by Guillaume Vincent
parent
commit
4ac0105a66
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      cli/lesspass/clipboard.py

+ 2
- 1
cli/lesspass/clipboard.py View File

@@ -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():


Loading…
Cancel
Save