]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421) (GH-7456)
authorVictor Stinner <vstinner@redhat.com>
Wed, 6 Jun 2018 17:04:50 +0000 (19:04 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Jun 2018 17:04:50 +0000 (19:04 +0200)
commit67b7158d53f33ed644cc11ef394470a859ea8bad
tree0832d9af25f0afd10cbb4d66d15abb6099dd2cc2
parente5b79c546370521764457ea2ec809303e580f5ea
bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421) (GH-7456)

Substract one because listdir() opens internally a file
descriptor to list the content of the /proc/self/fd/ directory.

Add test_support.test_fd_count().

Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure
that the report mode is always restored on failure.

(cherry picked from commit 492d6424a7ca907c8ec1df21e51062e8f3d88e32)
Lib/test/support/__init__.py
Lib/test/test_test_support.py