Reputation: 21
I am using the python subprocess module to create subprocesses. I check the status of subprocess by using the Popen.poll() method.
The documentation of subprocess module mention about negative value and none value return codes. But not about positive return codes.Popen.poll() is returning 1 in my case. What does that mean?
The child return code, set by poll() and wait() (and indirectly by communicate()). A None value indicates that the process hasn’t terminated yet. A negative value -N indicates that the child was terminated by signal N (Unix only).
Upvotes: 0
Views: 5141
Reputation: 136
From the documentation on the poll method of the Popen class:
Check if child process has terminated. Set and return returncode attribute.
So poll returns None if the process hasn't terminated yet, a negative value -N if it was terminated by a signal N and the return code of the process otherwise.
Upvotes: 2