def reap_children():
<EOL>import os<EOL>if hasattr(os, '<STR_LIT>'):<EOL><INDENT>any_process = -<NUM_LIT:1><EOL>while True:<EOL><INDENT>try:<EOL><INDENT>pid, status = os.waitpid(any_process, os.WNOHANG)<EOL>if pid == <NUM_LIT:0>:<EOL><INDENT>break<EOL><DEDENT><DEDENT>except:<EOL><INDENT>break<EOL><DEDENT><DEDENT><DEDENT>
Use this function at the end of test_main() whenever sub-processes
    are started.  This will help ensure that no extra children (zombies)
    stick around to hog resources and create problems when looking
    for refleaks.