Skip to content

Commit a8017be

Browse files
committed
Address feedback
1 parent 9a862b5 commit a8017be

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Lib/multiprocessing/util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,16 @@ def log_to_stderr(level=None):
106106
# Abstract socket support
107107

108108
def _platform_supports_abstract_sockets():
109-
if "linux" in sys.platform:
109+
if sys.platform == "linux":
110110
return True
111111
if hasattr(sys, 'getandroidapilevel'):
112112
return True
113113
return False
114114

115115

116116
def is_abstract_socket_namespace(address):
117+
if not address:
118+
return False
117119
if isinstance(address, bytes):
118120
return address[0] == 0
119121
elif isinstance(address, str):

Lib/test/_test_multiprocessing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3279,12 +3279,12 @@ def test_context(self):
32793279
def test_abstract_socket(self):
32803280
with self.connection.Listener("\0something") as listener:
32813281
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)
32843284
self.assertEqual(d.recv(), 1729)
32853285

32863286
if self.TYPE == 'processes':
3287-
self.assertRaises(OSError, l.accept)
3287+
self.assertRaises(OSError, listener.accept)
32883288

32893289

32903290
class _TestListenerClient(BaseTestCase):

0 commit comments

Comments
 (0)