Skip to content

Commit 3d1eb5d

Browse files
FIX has_ffmpeg()
1 parent 72194ce commit 3d1eb5d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

surfer/utils.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,12 @@ def has_ffmpeg():
643643
ffmpeg_exists : bool
644644
True if FFmpeg can be successfully called, False otherwise.
645645
"""
646-
rcode = subprocess.call(["type", "ffmpeg"], stdout=subprocess.PIPE,
647-
stderr=subprocess.PIPE)
648-
ffmpeg_exists = rcode == 0
649-
return ffmpeg_exists
646+
try:
647+
subprocess.call(["ffmpeg"], stdout=subprocess.PIPE,
648+
stderr=subprocess.PIPE)
649+
return True
650+
except OSError:
651+
return False
650652

651653

652654
def assert_ffmpeg_is_available():

0 commit comments

Comments
 (0)