I am new to python, so this is a very basic error on my part, I just don't see it...
In the code below, I am expecting that if the data seen by tn.read_until, (calll:), is not seen, the script will run the block of code below 'except', and the exitscript() function will be called...
That appears to not be happening... It is as if no error is being raised, the script just ignores the entire 'except" path. Can someone explain what I am missing here please? I suspect I am not looking for the right trigger here...
Code follows:
try:
tn.read_until(b"calll:", timeout=5)
except EOFError:
logdata = 'Timeout reached in login.'
logit(logdata)
failcode = 4
exitscript() # Leave script, EC4 set.
else:
tn.write(USER.encode("ascii") + b"\n")
rest of script...