##// END OF EJS Templates
chgserver: remove Python 2 support code...
Gregory Szorc -
r50143:0bb28b77 default
parent child Browse files
Show More
@@ -439,16 +439,13 b' class chgcmdserver(commandserver.server)'
439 439 ui = self.ui
440 440 for (ch, fp, fd), (cn, fn, mode) in zip(self._oldios, _iochannels):
441 441 newfp = getattr(ui, fn)
442 # On Python 2, newfp and fp may be separate file objects associated
443 # with the same fd, so we must close newfp while it's associated
444 # with the client. Otherwise the new associated fd would be closed
445 # when newfp gets deleted. On Python 3, newfp is just a wrapper
446 # around fp even if newfp is not fp, so deleting newfp is safe.
447 if not (pycompat.ispy3 or newfp is fp):
442 # On Python 3, newfp is just a wrapper around fp even if newfp is
443 # not fp, so deleting newfp is safe.
444 if newfp is not fp:
448 445 newfp.close()
449 446 # restore original fd: fp is open again
450 447 try:
451 if (pycompat.ispy3 or newfp is fp) and 'w' in mode:
448 if newfp is fp and 'w' in mode:
452 449 # Discard buffered data which couldn't be flushed because
453 450 # of EPIPE. The data should belong to the current session
454 451 # and should never persist.
General Comments 0
You need to be logged in to leave comments. Login now