]> granicus.if.org Git - python/commit
bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421)
authorVictor Stinner <vstinner@redhat.com>
Wed, 6 Jun 2018 15:23:50 +0000 (17:23 +0200)
committerGitHub <noreply@github.com>
Wed, 6 Jun 2018 15:23:50 +0000 (17:23 +0200)
commit492d6424a7ca907c8ec1df21e51062e8f3d88e32
treed88718e085da33d6a105054e201611ee3aca1ddf
parent45e4efba7fa2abe61d25e4f8b5bf482e19ff1280
bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421)

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.
Lib/test/support/__init__.py
Lib/test/test_support.py