Python pty.spawn not working

I’m having the same issue. But in my case, it closes out my reverse connection and knocks me to my host machine terminal.

Here is the output -

What will be a solution for this? @TazWake