Mercurial > public > mercurial-scm > hg
comparison mercurial/utils/procutil.py @ 44919:065704cbdbdb stable 5.4.1
py3: update comment to account for Python 2 and Python 3 differences
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Fri, 05 Jun 2020 06:40:15 +0200 |
parents | 79f6f856c53f |
children | 78cafd48b9b2 95c672c07116 |
comparison
equal
deleted
inserted
replaced
44918:7be784f301fa | 44919:065704cbdbdb |
---|---|
47 return fp.isatty() | 47 return fp.isatty() |
48 except AttributeError: | 48 except AttributeError: |
49 return False | 49 return False |
50 | 50 |
51 | 51 |
52 # glibc determines buffering on first write to stdout - if we replace a TTY | 52 # Python 2 uses the C library's standard I/O streams. Glibc determines |
53 # destined stdout with a pipe destined stdout (e.g. pager), we want line | 53 # buffering on first write to stdout - if we replace a TTY destined stdout with |
54 # buffering (or unbuffered, on Windows) | 54 # a pipe destined stdout (e.g. pager), we want line buffering (or unbuffered, |
55 # on Windows). | |
56 # Python 3 rolls its own standard I/O streams. | |
55 if isatty(stdout): | 57 if isatty(stdout): |
56 if pycompat.iswindows: | 58 if pycompat.iswindows: |
57 # Windows doesn't support line buffering | 59 # Windows doesn't support line buffering |
58 stdout = os.fdopen(stdout.fileno(), 'wb', 0) | 60 stdout = os.fdopen(stdout.fileno(), 'wb', 0) |
59 elif not pycompat.ispy3: | 61 elif not pycompat.ispy3: |