Best Way To Bound Function Execution Time

Tim Daneliuk tundra at tundraware.com
Sat Dec 31 15:26:27 EST 2011


I am writing some paramiko-based ssh routines.  One of them logs into
a remote server and then does a sudo command.  The problem is that if
the user provides the incorrect sudo password, the call hangs the other
end is waiting for the correct password to be entered.

Is there some standard Pythonic way to bound how long a function
call can run, after which time it is forcefully terminated?

TIA,
-- 
----------------------------------------------------------------------------
Tim Daneliuk     tundra at tundraware.com
PGP Key:         http://www.tundraware.com/PGP/




More information about the Python-list mailing list