--- a/mercurial/hook.py Tue Nov 08 22:22:22 2016 +0900
+++ b/mercurial/hook.py Tue Nov 08 22:41:45 2016 +0900
@@ -209,11 +209,11 @@
for hname, cmd in hooks:
if oldstdout == -1 and _redirect:
try:
- stdoutno = sys.__stdout__.fileno()
- stderrno = sys.__stderr__.fileno()
+ stdoutno = sys.stdout.fileno()
+ stderrno = sys.stderr.fileno()
# temporarily redirect stdout to stderr, if possible
if stdoutno >= 0 and stderrno >= 0:
- sys.__stdout__.flush()
+ sys.stdout.flush()
oldstdout = os.dup(stdoutno)
os.dup2(stderrno, stdoutno)
except (OSError, AttributeError):
@@ -258,7 +258,7 @@
sys.stderr.flush()
finally:
if _redirect and oldstdout >= 0:
- sys.__stdout__.flush() # write hook output to stderr fd
+ sys.stdout.flush() # write hook output to stderr fd
os.dup2(oldstdout, stdoutno)
os.close(oldstdout)