I am trying to run following code which uses pythos 'subprocess' module.
subprocess.call(cli_args, stdout=client_log, stderr=client_log, timeout=10)
I am using timeout arguement, which is mentioned here to skip from this line if the subprocess stuck at the middle, by killing it. But when I run this, I am getting following error.
Traceback (most recent call last):
File "test.py", line 152, in <module>
ret = runServiceTest(test_name, server_executable, server_extra_args, client_executable, client_extra_args, protocol, transport, 9090, 0, 0)
File "test.py", line 102, in runServiceTest
ret = subprocess.call(cli_args, stdout=client_log, stderr=client_log, timeout=10)
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
TypeError: __init__() got an unexpected keyword argument 'timeout'
What is the reason for this? How can I solve this? My complete code can be found here.