From 9193b9978a16302225855bde8dc9e5fba0842e6e Mon Sep 17 00:00:00 2001 From: Quanyi Mo Date: Thu, 20 Aug 2015 09:35:44 -0600 Subject: [PATCH] stdin redirected, prevent stdin frozen after call get_windows() --- selective_search.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selective_search.py b/selective_search.py index 4c3ff9f..bde5fcd 100644 --- a/selective_search.py +++ b/selective_search.py @@ -33,7 +33,7 @@ def get_windows(image_fnames, cmd='selective_search'): # Execute command in MATLAB. mc = "matlab -nojvm -r \"try; {}; catch; exit; end; exit\"".format(command) pid = subprocess.Popen( - shlex.split(mc), stdout=open('/dev/null', 'w'), cwd=script_dirname) + shlex.split(mc), stdin=subprocess.PIPE, stdout=open('/dev/null', 'w'), cwd=script_dirname) retcode = pid.wait() if retcode != 0: raise Exception("Matlab script did not exit successfully!")