def deadlock_prevention_noncompliant()

in src/python/detectors/multiprocessing_deadlock_prevention/multiprocessing_deadlock_prevention.py [0:0]


def deadlock_prevention_noncompliant():
    from subprocess import Popen, PIPE
    process = Popen('sh ~/example.sh', stdout=PIPE)
    # Noncompliant: uses the 'Popen.wait' with 'stdout=PIPE' or 'stderr=PIPE',
    # resulting in a potential deadlock and busy loop.
    process.wait()
    print(process.returncode)