summaryrefslogtreecommitdiffstats
path: root/Lib/socket.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/socket.py')
-rw-r--r--Lib/socket.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/socket.py b/Lib/socket.py
index 2dc9736..d0da740 100644
--- a/Lib/socket.py
+++ b/Lib/socket.py
@@ -307,7 +307,10 @@ class SocketIO(io.RawIOBase):
@property
def name(self):
- return self.fileno()
+ if not self.closed:
+ return self.fileno()
+ else:
+ return -1
@property
def mode(self):