From 7af694e66156e9f572eb92492b9e22cd72febb8c 2014-07-09 19:45:13 From: Min RK Date: 2014-07-09 19:45:13 Subject: [PATCH] Merge pull request #6102 from etgalloway/script-magic-cmd Add newline if missing to end of script magic cell --- diff --git a/IPython/core/magics/script.py b/IPython/core/magics/script.py index e4fd1f0..e0b42cb 100644 --- a/IPython/core/magics/script.py +++ b/IPython/core/magics/script.py @@ -193,6 +193,8 @@ class ScriptMagics(Magics): else: raise + if not cell.endswith('\n'): + cell += '\n' cell = cell.encode('utf8', 'replace') if args.bg: self.bg_processes.append(p)