##// END OF EJS Templates
tests: constant-fold a `pycompat.ispy3` in testlib/badserverext.py
Manuel Jacob -
r50193:425ca342 default
parent child Browse files
Show More
@@ -49,7 +49,6 import re
49 49 import socket
50 50
51 51 from mercurial import (
52 pycompat,
53 52 registrar,
54 53 )
55 54
@@ -335,17 +334,13 class fileobjectproxy:
335 334 object.__getattribute__(self, '_logfp').flush()
336 335
337 336 def _close(self):
338 # Python 3 uses an io.BufferedIO instance. Python 2 uses some file
339 # object wrapper.
340 if pycompat.ispy3:
337 # We wrap an io.BufferedIO instance.
341 338 orig = object.__getattribute__(self, '_orig')
342 339
343 340 if hasattr(orig, 'raw'):
344 341 orig.raw._sock.shutdown(socket.SHUT_RDWR)
345 342 else:
346 343 self.close()
347 else:
348 self._sock.shutdown(socket.SHUT_RDWR)
349 344
350 345 def read(self, size=-1):
351 346 cond = object.__getattribute__(self, '_cond')
General Comments 0
You need to be logged in to leave comments. Login now