From 963fcb57b6e0d6b802128ce900f455828b3ea327 Mon Sep 17 00:00:00 2001 From: Bernardo Damele Date: Fri, 29 Oct 2010 12:36:37 +0000 Subject: [PATCH] Minor bug fix --- extra/icmpsh/icmpsh_m.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/extra/icmpsh/icmpsh_m.py b/extra/icmpsh/icmpsh_m.py index b1d8c3e38..9bd5acfc7 100755 --- a/extra/icmpsh/icmpsh_m.py +++ b/extra/icmpsh/icmpsh_m.py @@ -25,14 +25,6 @@ import socket import subprocess import sys -def checkLibs(): - try: - from impacket import ImpactDecoder - from impacket import ImpactPacket - except ImportError: - sys.stderr.write('You need to install Python Impacket library first\n') - sys.exit(255) - def setNonBlocking(fd): """ Make a file descriptor non-blocking @@ -49,7 +41,12 @@ def main(src, dst): sys.stderr.write('icmpsh master can only run on Posix systems\n') sys.exit(255) - checkLibs() + try: + from impacket import ImpactDecoder + from impacket import ImpactPacket + except ImportError: + sys.stderr.write('You need to install Python Impacket library first\n') + sys.exit(255) # Make standard input a non-blocking file stdin_fd = sys.stdin.fileno()