From d4476c1a292ed5b9e90a2bc6e6269c0577c4c695 Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 9 Apr 2019 16:42:03 +0800 Subject: [PATCH] fix a bug --- utils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/utils.py b/utils.py index 3ee1c53..379a18c 100644 --- a/utils.py +++ b/utils.py @@ -72,12 +72,9 @@ def run_cmd(cmd, cwd=None, keepalive=False, KEEPALIVE_TIMEOUT=30, RUN_CMD_TIMEOU else: self.__file = None def append(self, mystring): - if self.__short_return: - if super().__len__() >= 20: - super.pop(0) - super().append(mystring) - else: - super().append(mystring) + if self.__short_return and super().__len__() >= 20: + super().pop(0) + super().append(mystring) if self.__file and type(mystring) is str: self.__file.write(mystring) def __enter__(self):