bpo-40280: Address more test failures on Emscripten (GH-31050)

Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
Christian Heimes 2022-02-05 21:52:01 +02:00 committed by GitHub
parent 9d4161a60c
commit 96b344c2f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 227 additions and 49 deletions

View file

@ -502,7 +502,7 @@ class FakePath:
def fd_count():
"""Count the number of open file descriptors.
"""
if sys.platform.startswith(('linux', 'freebsd')):
if sys.platform.startswith(('linux', 'freebsd', 'emscripten')):
try:
names = os.listdir("/proc/self/fd")
# Subtract one because listdir() internally opens a file