File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 26
26
from pkg_resources import resource_filename
27
27
from serial .serialutil import SerialException
28
28
29
+ from distutils .version import LooseVersion
30
+
29
31
IS_DARWIN = platform .system ().lower () == "darwin"
30
- OSX_SIERRA = 10.12
32
+ OSX_SIERRA = LooseVersion ( " 10.12" )
31
33
if IS_DARWIN :
32
- MAC_VERSION = float (platform .mac_ver ()[0 ])
34
+ IS_HIGH_SIERRA_OR_ABOVE = LooseVersion (platform .mac_ver ()[0 ])
33
35
else :
34
- MAC_VERSION = 0
36
+ IS_HIGH_SIERRA_OR_ABOVE = False
35
37
36
- DEFAULT_SERIAL_PORT = '/dev/ptyp0' if MAC_VERSION <= OSX_SIERRA else '/dev/ttyp0'
38
+ DEFAULT_SERIAL_PORT = '/dev/ptyp0' if not IS_HIGH_SIERRA_OR_ABOVE else '/dev/ttyp0'
37
39
38
40
if USE_PYMODBUS :
39
41
from modbus_simulator .utils .pymodbus_server import ModbusSimu
You can’t perform that action at this time.
0 commit comments