@@ -72,8 +72,8 @@ def _get_socket(socket_type, raises, *params):
72
72
def path_exists (returns , path ):
73
73
calls .append (('os.path.exists' , path ))
74
74
return returns
75
- def fcntl (* args ):
76
- calls .append (('fcntl ' ,) + args )
75
+ def ensure_not_inheritable (* args ):
76
+ calls .append (('ensure_not_inheritable ' ,) + args )
77
77
for params , allow_unix , unix_addr_exists , allow_tcp , expect_connection_error , expected_calls in (
78
78
# Successful explicit TCP socket connection.
79
79
(('tcp/host:6' , None , 'host' , 6 ), False , False , True , False , [
@@ -141,17 +141,15 @@ def fcntl(*args):
141
141
partial (_get_socket , 'tcp' , not allow_tcp )), \
142
142
patch ('os.path.exists' ,
143
143
partial (path_exists , unix_addr_exists )), \
144
- patch ('fcntl.fcntl ' , fcntl ):
144
+ patch ('Xlib.support.unix_connect._ensure_not_inheritable ' , ensure_not_inheritable ):
145
145
del calls [:]
146
146
if expect_connection_error :
147
147
with self .assertRaises (DisplayConnectionError ):
148
148
unix_connect .get_socket (* params )
149
149
else :
150
150
s = unix_connect .get_socket (* params )
151
151
self .assertIsInstance (s , FakeSocket )
152
- expected_calls .append (('fcntl' , 42 ,
153
- unix_connect .F_SETFD ,
154
- unix_connect .FD_CLOEXEC ))
152
+ expected_calls .append (('ensure_not_inheritable' , s ))
155
153
self .assertEqual (calls , expected_calls )
156
154
157
155
0 commit comments