Skip to content

Commit 0c175b4

Browse files
authored
Merge pull request #1400 from h-mayorquin/add_plexon_test_skip_condition
Skip plexon 2 tests when wine is not present
2 parents c96ec93 + cf651e1 commit 0c175b4

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
.idea
1616
*.swp
1717
*.swo
18+
.vscode
19+
1820

1921
# Compiled source #
2022
###################

neo/rawio/plexon2rawio/pypl2/pypl2lib.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,26 @@
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
12-
import os
11+
import platform
12+
import subprocess
1313
import pathlib
1414
import warnings
15+
import numpy as np
1516

16-
if any(platform.startswith(name) for name in ("linux", "darwin", "freebsd")):
17-
from zugbruecke import CtypesSession
17+
platform_is_windows = platform.system() == "Windows"
1818

19-
ctypes = CtypesSession(log_level=100)
20-
21-
elif platform.startswith("win"):
19+
if platform_is_windows:
2220
import ctypes
2321
else:
24-
raise SystemError("unsupported platform")
22+
is_wine_available = subprocess.run(
23+
["which", "wine"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False
24+
)
25+
if is_wine_available.returncode != 0:
26+
raise ImportError("Wine is not installed. Please install wine to use the PL2FileReader.dll")
2527

26-
import numpy as np
28+
from zugbruecke import CtypesSession
29+
30+
ctypes = CtypesSession(log_level=100)
2731

2832

2933
class tm(ctypes.Structure):

0 commit comments

Comments
 (0)