Skip to content
Snippets Groups Projects
Commit 163fa0ae authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

dispatch: move initialization of sys.std* files

I'll add another Python 3 hack.
parent b09b3eaf
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,4 @@
dispatch.runcommand = runcommand
for fp in (sys.stdin, sys.stdout, sys.stderr):
util.setbinary(fp)
dispatch.run()
......@@ -37,11 +37,5 @@
sys.stderr.write("(check your install and PYTHONPATH)\n")
sys.exit(-1)
from mercurial import (
dispatch,
util,
)
for fp in (sys.stdin, sys.stdout, sys.stderr):
util.setbinary(fp)
from mercurial import dispatch
dispatch.run()
......@@ -75,6 +75,7 @@
def run():
"run the command in sys.argv"
_initstdio()
req = request(pycompat.sysargv[1:])
err = None
try:
......@@ -95,6 +96,10 @@
req.ui.ferr.flush()
sys.exit(status & 255)
def _initstdio():
for fp in (sys.stdin, sys.stdout, sys.stderr):
util.setbinary(fp)
def _getsimilar(symbols, value):
sim = lambda x: difflib.SequenceMatcher(None, value, x).ratio()
# The cutoff for similarity here is pretty arbitrary. It should
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment