File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -106,14 +106,16 @@ def log_to_stderr(level=None):
106
106
# Abstract socket support
107
107
108
108
def _platform_supports_abstract_sockets ():
109
- if "linux" in sys .platform :
109
+ if sys .platform == "linux" :
110
110
return True
111
111
if hasattr (sys , 'getandroidapilevel' ):
112
112
return True
113
113
return False
114
114
115
115
116
116
def is_abstract_socket_namespace (address ):
117
+ if not address :
118
+ return False
117
119
if isinstance (address , bytes ):
118
120
return address [0 ] == 0
119
121
elif isinstance (address , str ):
Original file line number Diff line number Diff line change @@ -3279,12 +3279,12 @@ def test_context(self):
3279
3279
def test_abstract_socket (self ):
3280
3280
with self .connection .Listener ("\0 something" ) as listener :
3281
3281
with self .connection .Client (l .address ) as client :
3282
- with l .accept () as d :
3283
- c .send (1729 )
3282
+ with listener .accept () as d :
3283
+ client .send (1729 )
3284
3284
self .assertEqual (d .recv (), 1729 )
3285
3285
3286
3286
if self .TYPE == 'processes' :
3287
- self .assertRaises (OSError , l .accept )
3287
+ self .assertRaises (OSError , listener .accept )
3288
3288
3289
3289
3290
3290
class _TestListenerClient (BaseTestCase ):
You can’t perform that action at this time.
0 commit comments