Fixed the timeout `ShellTestCase` code to work on python 2.6