Commit a1d7e48a authored by Jason Madden's avatar Jason Madden

Remove print statements, simplify expression.

parent f318b6d2
......@@ -65,7 +65,7 @@ class socket(object):
# Only defined under Linux
@property
def type(self):
return _socket.socket.type.__get__(self._sock) & ~_socket.SOCK_NONBLOCK
return self._sock.type & ~_socket.SOCK_NONBLOCK
def __enter__(self):
return self
......
......@@ -187,15 +187,12 @@ class TestTCP(greentest.TestCase):
def test_attributes(self):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
print("Socket type", s.type)
self.assertEqual(socket.AF_INET, s.type)
self.assertEqual(socket.SOCK_DGRAM, s.family)
self.assertEqual(0, s.proto)
if hasattr(socket, 'SOCK_NONBLOCK'):
print("Has non-block")
s.settimeout(1)
print("Socket type with timeout", s.type)
self.assertEqual(socket.AF_INET, s.type)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment