From 04f0386719bde5aa2e0740e78d25df6fde183c5d Mon Sep 17 00:00:00 2001 From: talkaminker Date: Thu, 19 Jan 2017 19:42:20 +0200 Subject: [PATCH] remove unnecessary newlines in run cell Fixes https://github.com/spyder-ide/spyder/issues/3992 --- spyder/widgets/sourcecode/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spyder/widgets/sourcecode/base.py b/spyder/widgets/sourcecode/base.py index 7b4c35d59be..93b981297d2 100644 --- a/spyder/widgets/sourcecode/base.py +++ b/spyder/widgets/sourcecode/base.py @@ -629,6 +629,8 @@ def get_cell_as_executable_code(self): self.setTextCursor(cursor) text = self.get_selection_as_executable_code() self.__restore_selection(start_pos, end_pos) + if text is not None: + text = text.rstrip() return text def is_cell_separator(self, cursor=None, block=None):