Mercurial > public > mercurial-scm > hg-stable
comparison tests/test-stdio.py @ 53031:e705fec4a03f stable
branching: merging with 7.0 changes
Since 6.9.3 was made after 7.0rc0 we need to deal with more branching than
usual.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 05 Mar 2025 23:02:19 +0100 |
parents | f8f14e6d032b |
children |
comparison
equal
deleted
inserted
replaced
53030:74439d1cbeba | 53031:e705fec4a03f |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python3 |
2 """ | 2 """ |
3 Tests the buffering behavior of stdio streams in `mercurial.utils.procutil`. | 3 Tests the buffering behavior of stdio streams in `mercurial.utils.procutil`. |
4 """ | 4 """ |
5 | 5 |
6 import contextlib | 6 import contextlib |
86 yield | 86 yield |
87 finally: | 87 finally: |
88 for fd in fds: | 88 for fd in fds: |
89 try: | 89 try: |
90 os.close(fd) | 90 os.close(fd) |
91 except EnvironmentError: | 91 except OSError: |
92 pass | 92 pass |
93 | 93 |
94 | 94 |
95 # In the following, we set the FDs non-inheritable mainly to make it possible | 95 # In the following, we set the FDs non-inheritable mainly to make it possible |
96 # for tests to close the receiving end of the pipe / PTYs. | 96 # for tests to close the receiving end of the pipe / PTYs. |