Changeset 3528:f05eb4b4ebd1 in livinglogic.python.xist

Show
Ignore:
Timestamp:
07/18/08 23:28:33 (11 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Avoid duplication locations in the exception output.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/ul4c.py

    r3527 r3528  
    116116        exc = self 
    117117        while isinstance(exc, Error): 
    118             path.append(str(exc.location)) 
     118            if not path or path[-1] is not exc.location: 
     119                path.append(exc.location) 
    119120            exc = exc.cause 
    120121        name = exc.__class__.__name__ 
     
    122123        if module != "exceptions": 
    123124            name = "%s.%s" % (module, name) 
    124         return "%s in %s: %s" % (name, ": in ".join(path), exc) 
     125        return "%s %s %s" % (name, "".join("in %s:" % location for location in path), exc) 
    125126 
    126127