Commit 4d4fc71c authored by Brandon Smith's avatar Brandon Smith

Specify global for function using global

parent f21515ad
...@@ -7,6 +7,7 @@ import pexpect ...@@ -7,6 +7,7 @@ import pexpect
ssh = None ssh = None
def handler(signum, frame): def handler(signum, frame):
global ssh
if ssh: if ssh:
ssh.kill(signum) ssh.kill(signum)
sys.exit(signum) sys.exit(signum)
...@@ -16,6 +17,7 @@ signal.signal(signal.SIGTERM, handler) ...@@ -16,6 +17,7 @@ signal.signal(signal.SIGTERM, handler)
signal.signal(signal.SIGINT, handler) signal.signal(signal.SIGINT, handler)
def winch_handler(signum, frame): def winch_handler(signum, frame):
global ssh
if ssh: if ssh:
rows, cols = os.popen('stty size', 'r').read().split() rows, cols = os.popen('stty size', 'r').read().split()
ssh.setwinsize(int(rows), int(cols)) ssh.setwinsize(int(rows), int(cols))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment