Skip to content

Commit

Permalink
Use shutil.which to check if litestream is available
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludovico Righi committed Jul 23, 2024
1 parent 8c98efc commit a5d8173
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions test/int/litestream/test_replica.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@


def is_litestream_available():
try:
subprocess.run(
["litestream", "version"],
check=True,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
except (subprocess.CalledProcessError, FileNotFoundError):
return False
return True
return True if shutil.which("litestream") else False


def start_litestream(db_path, replica_path):
Expand Down

0 comments on commit a5d8173

Please sign in to comment.