Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 30482:39d13b8c101d
py3: bulk replace sys.stdin/out/err by util's
Almost all sys.stdin/out/err in hgext/ and mercurial/ are replaced by util's.
There are a few exceptions:
- lsprof.py and statprof.py are untouched since they are a kind of vendor
code and they never import mercurial modules right now.
- ui._readline() needs to replace sys.stdin and stdout to pass them to
raw_input(). We'll need another workaround here.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 20 Oct 2016 23:53:36 +0900 |
parents | e1677cc29da6 |
children | 751639bf6fc4 |
comparison
equal
deleted
inserted
replaced
30481:277f4fe6d01a | 30482:39d13b8c101d |
---|---|
886 os.chdir(inst[6:]) | 886 os.chdir(inst[6:]) |
887 elif inst != 'none': | 887 elif inst != 'none': |
888 raise error.Abort(_('invalid value for --daemon-postexec: %s') | 888 raise error.Abort(_('invalid value for --daemon-postexec: %s') |
889 % inst) | 889 % inst) |
890 util.hidewindow() | 890 util.hidewindow() |
891 sys.stdout.flush() | 891 util.stdout.flush() |
892 sys.stderr.flush() | 892 util.stderr.flush() |
893 | 893 |
894 nullfd = os.open(os.devnull, os.O_RDWR) | 894 nullfd = os.open(os.devnull, os.O_RDWR) |
895 logfilefd = nullfd | 895 logfilefd = nullfd |
896 if logfile: | 896 if logfile: |
897 logfilefd = os.open(logfile, os.O_RDWR | os.O_CREAT | os.O_APPEND) | 897 logfilefd = os.open(logfile, os.O_RDWR | os.O_CREAT | os.O_APPEND) |