Skip to content

Commit 72238a3

Browse files
committed
Change sys to os lib for win detection.
1 parent 84c6c57 commit 72238a3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

axelrod/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import
2-
import sys
2+
import os
33

4-
on_windows = sys.platform.startswith("win")
4+
on_windows = os.name == 'nt'
55

66
# The order of imports matters!
77
from .actions import Actions, flip_action

axelrod/tests/unit/test_windows_detection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import unittest
2-
import sys
2+
import os
33
import axelrod
44

55
class TestWindowsDetection(unittest.TestCase):
66

7-
@unittest.skipIf(sys.platform.startswith("win"),
7+
@unittest.skipIf(os.name == 'nt',
88
"Skip this test if on windows")
99
def test_detection_on_not_windows(self):
1010
"""Test when not on windows"""
1111
self.assertFalse(axelrod.on_windows)
1212

13-
@unittest.skipIf(not sys.platform.startswith("win"),
13+
@unittest.skipIf(os.name != 'nt',
1414
"Skip this test if not on windows")
1515
def test_detection_on_not_windows(self):
1616
"""Test when on windows"""

0 commit comments

Comments
 (0)