def decode_exit(exit_code):
    """Decodes the exit code returned by os.system() into a tuple
       containing the exit status, the signal, and 1 if the core was dumped.
       See os.wait() for the specification of exit_code"""

    status = exit_code >> 8		# the high byte
    signal = exit_code & 0x7f		# the lowest 7 bits
    core = (exit_code & 0xff) >> 7	# the high bit of the low byte

    return (status, signal, core)