From: Fredrik Tolf Date: Sat, 19 Jan 2013 00:34:01 +0000 (+0100) Subject: Properly split exception reports into lines. X-Git-Tag: 0.2~1 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=0eaf2431e1ea4e5aabb599d381bff7e71ae69fe9;hp=342c8c21078cb74025b2f242b3649628a96ccb1d;p=pdm.git Properly split exception reports into lines. --- diff --git a/pdm/srv.py b/pdm/srv.py index 8eb11f5..b2c131a 100644 --- a/pdm/srv.py +++ b/pdm/srv.py @@ -61,8 +61,10 @@ class repl(object): self.echo(eval(ccode, self.mod.__dict__)) self.cl.send("+OK\n") except: - for line in traceback.format_exception(*sys.exc_info()): - self.cl.send(" " + line) + lines = ("".join(traceback.format_exception(*sys.exc_info()))).split("\n") + while len(lines) > 0 and lines[-1] == "": lines = lines[:-1] + for line in lines: + self.cl.send(" " + line + "\n") self.cl.send("+EXC\n") def handle(self, buf):