From 9ab521202855bcf4ea82ae37d89a9f1eae06f43d Mon Sep 17 00:00:00 2001 From: Sören Tempel Date: Mon, 24 May 2021 20:37:39 +0200 Subject: history: Use .rstrip() for removing trailing newlines --- saneterm/history.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/saneterm/history.py b/saneterm/history.py index 12882e1..1226446 100644 --- a/saneterm/history.py +++ b/saneterm/history.py @@ -34,13 +34,10 @@ class History(): self.__con.close() def add_entry(self, fd, entry): - exe = self.__get_exec(fd) - - # Strip trailing newline (if any). + entry = entry.rstrip('\n') if len(entry) == 0: return - elif entry[-1] == '\n': - entry = entry[0:-1] + exe = self.__get_exec(fd) # Insert new entry into table and make sure the **total** amount # of entries in the entire table does not exceed self.histsize. -- cgit 1.4.1