Skip to content

Commit 4a953bb

Browse files
committed
multiprocessing/utils.close_fds also has to work for fake (negative)
graalpython _multiprocessing file descriptors
1 parent a7e024c commit 4a953bb

File tree

1 file changed

+11
-1
lines changed
  • graalpython/lib-python/3/multiprocessing

1 file changed

+11
-1
lines changed

graalpython/lib-python/3/multiprocessing/util.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919
from . import process
2020

21+
# Begin Truffle change
22+
from _multiprocessing import _close
23+
# End Truffle change
24+
2125
__all__ = [
2226
'sub_debug', 'debug', 'info', 'sub_warning', 'get_logger',
2327
'log_to_stderr', 'get_temp_dir', 'register_after_fork',
@@ -461,7 +465,13 @@ def spawnv_passfds(path, args, passfds):
461465
def close_fds(*fds):
462466
"""Close each file descriptor given as an argument"""
463467
for fd in fds:
464-
os.close(fd)
468+
# Begin Truffle change
469+
#os.close(fd)
470+
if fd < 0:
471+
_close(fd)
472+
else:
473+
os.close(fd)
474+
# End Truffle change
465475

466476

467477
def _cleanup_tests():

0 commit comments

Comments
 (0)