Skip to content

Commit cf651e1

Browse files
committed
switch strategy
1 parent 60a6604 commit cf651e1

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

neo/rawio/plexon2rawio/pypl2/pypl2lib.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,22 @@
88
# You are free to modify or share this file, provided that the above
99
# copyright notice is kept intact.
1010

11-
from sys import platform
11+
import platform
1212
import subprocess
1313
import pathlib
1414
import warnings
1515
import numpy as np
1616

17-
plataform_is_windows = platform.system() == "Windows"
17+
platform_is_windows = platform.system() == "Windows"
1818

19-
if plataform_is_windows:
19+
if platform_is_windows:
2020
import ctypes
2121
else:
22-
pltaform_is_linux = platform.system() == "Linux"
23-
if pltaform_is_linux:
24-
try:
25-
is_wine_available = subprocess.run(
26-
["wine", "--version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False
22+
is_wine_available = subprocess.run(
23+
["which", "wine"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False
2724
)
28-
except subprocess.CalledProcessError:
29-
raise ImportError("Wine is not installed. Please install wine to use the PL2FileReader.dll")
25+
if is_wine_available.returncode != 0:
26+
raise ImportError("Wine is not installed. Please install wine to use the PL2FileReader.dll")
3027

3128
from zugbruecke import CtypesSession
3229

0 commit comments

Comments
 (0)