Skip to content

Commit

Permalink
Improve Read Until keywords performance.
Browse files Browse the repository at this point in the history
  • Loading branch information
mparvu committed Jun 16, 2021
1 parent a23b2f9 commit 8e77942
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SSHLibrary/abstractclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import glob
import posixpath
import ntpath
import sys

from .config import (Configuration, IntegerEntry, NewlineEntry, StringEntry,
TimeEntry)
Expand Down Expand Up @@ -475,7 +476,7 @@ def _read_until(self, matcher, expected, timeout=None):
output += self.read_char()
if matcher(output):
return output
time.sleep(.00001) # Release GIL so paramiko I/O thread can run
sys.__stdout__.write('.\b') # Release GIL so paramiko I/O thread can run
raise SSHClientException("No match found for '%s' in %s\nOutput:\n%s."
% (expected, timeout, output))

Expand Down

0 comments on commit 8e77942

Please sign in to comment.