diff options
-rw-r--r-- | sploit/comm.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sploit/comm.py b/sploit/comm.py index 0bc8c6a..afa14e8 100644 --- a/sploit/comm.py +++ b/sploit/comm.py @@ -41,11 +41,13 @@ class Comm: pred = bind(pred, *args, **kwargs) l = self.logonread self.logonread = False - while(True): - data += self.read(1) - if(pred(data)): - break - self.logonread = l + try: + while(True): + data += self.read(1) + if(pred(data)): + break + finally: + self.logonread = l if self.logonread : ilog(data, file=sys.stdout, color=NORMAL) return data |