Daniel Urban <urban.dani...@gmail.com> added the comment:

So, I see four possible solutions:

1. If we get a tuple, create the new tuple, normalize the exception, and store 
it.  If we get a SyntaxError instance, use its args, create the new tuple, 
normalize, and store.  (In this case a SyntaxError instance will be created 
twice.)

2. If we get a tuple, create the new tuple and store it without normalization.  
If we get a SyntaxError instance use its args to create the new tuple and store 
it without normalization.  (I think, that later it's still possible that a new 
SynaxError will be created, but we don't create it here.)

3. If we get a tuple, create the new tuple, and store it without normalization. 
 If we get a SyntaxError, take its args, create the new tuple, and call 
SyntaxError.__init__ with it. I think this will set all fields properly.

4. Like 3., but if we got a tuple, store the new tuple with normalization.

My patch currently does 1. 
My patch, without the PyErr_NormalizeException() call would be 2.
I think maybe 3. would be the best solution, or 4., if normalization is desired 
in all cases.

I can write a new patch, if the experts tell me what is the best solution from 
the four (or some other I didn't think of).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11441>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to