|
@@ -1,4 +1,4 @@
|
1
|
|
-# This whole file is a copy of the 'telnetlib.py' that came with Python 2.7.9 distribution.
|
|
1
|
+# This whole file is a copy of the 'telnetlib.py' that came with Python 2.7.12 distribution.
|
2
|
2
|
# A patch was applied to this file, in order to stop dropping null (0x00) characters.
|
3
|
3
|
|
4
|
4
|
r"""TELNET client class.
|
|
@@ -257,12 +257,13 @@ class Telnet:
|
257
|
257
|
|
258
|
258
|
def close(self):
|
259
|
259
|
"""Close the connection."""
|
260
|
|
- if self.sock:
|
261
|
|
- self.sock.close()
|
|
260
|
+ sock = self.sock
|
262
|
261
|
self.sock = 0
|
263
|
262
|
self.eof = 1
|
264
|
263
|
self.iacseq = ''
|
265
|
264
|
self.sb = 0
|
|
265
|
+ if sock:
|
|
266
|
+ sock.close()
|
266
|
267
|
|
267
|
268
|
def get_socket(self):
|
268
|
269
|
"""Return the socket object used internally."""
|