Chromium Code Reviews| Index: gclient_utils.py |
| diff --git a/gclient_utils.py b/gclient_utils.py |
| index 54d4e0ecf5ce374556006a502b0f05a3fd471361..dbbe6eb2be31914df4ff6ce0100e321b6cb9451b 100644 |
| --- a/gclient_utils.py |
| +++ b/gclient_utils.py |
| @@ -22,8 +22,11 @@ import subprocess2 |
| class Error(Exception): |
| """gclient exception class.""" |
| - pass |
| - |
| + def __init__(self, msg, *args, **kwargs): |
| + index = getattr(threading.currentThread(), 'index', 0) |
| + if index: |
| + msg = '\n'.join(['%d>_____ %s' % (index, l) for l in msg.splitlines()]) |
|
M-A Ruel
2013/05/24 22:25:56
I like the idea but two things:
- A generator is s
szager1
2013/05/24 22:48:16
I changed the format. As for using a generator --
M-A Ruel
2013/05/24 22:59:20
You misunderstood. I meant removing the brackets,
|
| + Exception.__init__(self, msg, *args, **kwargs) |
|
M-A Ruel
2013/05/24 22:25:56
I think super() works here. The old-style class pr
szager1
2013/05/24 22:48:16
Done.
|
| def SplitUrlRevision(url): |
| """Splits url and returns a two-tuple: url, rev""" |