File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 6
6
from test .support import warnings_helper
7
7
from test .support .script_helper import assert_python_ok
8
8
9
- # Skip these tests if there is no posix module.
10
- posix = import_helper .import_module ('posix' )
11
-
12
9
import errno
13
10
import sys
14
11
import signal
22
19
import textwrap
23
20
from contextlib import contextmanager
24
21
22
+ try :
23
+ import posix
24
+ except ImportError :
25
+ import nt as posix
26
+
25
27
try :
26
28
import pwd
27
29
except ImportError :
@@ -1009,6 +1011,7 @@ def test_environ(self):
1009
1011
self .assertEqual (type (k ), item_type )
1010
1012
self .assertEqual (type (v ), item_type )
1011
1013
1014
+ @unittest .skipUnless (os .name == 'posix' , "see bug gh-111841" )
1012
1015
def test_putenv (self ):
1013
1016
with self .assertRaises (ValueError ):
1014
1017
os .putenv ('FRUIT\0 VEGETABLE' , 'cabbage' )
@@ -1220,6 +1223,7 @@ def test_sched_setaffinity(self):
1220
1223
self .assertRaises (OSError , posix .sched_setaffinity , - 1 , mask )
1221
1224
1222
1225
@unittest .skipIf (support .is_wasi , "No dynamic linking on WASI" )
1226
+ @unittest .skipUnless (os .name == 'posix' , "POSIX-only test" )
1223
1227
def test_rtld_constants (self ):
1224
1228
# check presence of major RTLD_* constants
1225
1229
posix .RTLD_LAZY
You can’t perform that action at this time.
0 commit comments