@@ -25,12 +25,7 @@ def _resource_unlink(name, rtype):
25
25
26
26
def get_rtracker_fd ():
27
27
resource_tracker .ensure_running ()
28
- fd = resource_tracker ._resource_tracker ._fd
29
- if sys .platform == "win32" :
30
- import msvcrt
31
-
32
- fd = msvcrt .get_osfhandle (fd )
33
- return fd
28
+ return resource_tracker ._resource_tracker ._fd
34
29
35
30
36
31
class TestResourceTracker :
@@ -45,12 +40,15 @@ def test_resource_utils(self, rtype):
45
40
assert not resource_exists (name , rtype )
46
41
47
42
def test_child_retrieves_resource_tracker (self ):
48
- parent_rtracker_fd = get_rtracker_fd ()
49
- executor = ProcessPoolExecutor (max_workers = 2 )
50
- child_rtracker_fd = executor .submit (get_rtracker_fd ).result ()
51
43
52
44
# First simple fd retrieval check (see #200)
53
- assert child_rtracker_fd == parent_rtracker_fd
45
+ # checking fd only work on posix for now
46
+ if sys .platform != "win32" :
47
+ parent_rtracker_fd = get_rtracker_fd ()
48
+ executor = ProcessPoolExecutor (max_workers = 2 )
49
+ child_rtracker_fd = executor .submit (get_rtracker_fd ).result ()
50
+
51
+ assert child_rtracker_fd == parent_rtracker_fd
54
52
55
53
# Register a resource in the parent process, and un-register it in the
56
54
# child process. If the two processes do not share the same
0 commit comments