Vinay Sajip <vinay_sa...@yahoo.co.uk> added the comment:

----- Original Message ----

Reversing the if-else in Florent's suggestion seems to 
> address points (1) and (2).  Is there a reason to set and check an mp 
> variable rather than simply having the try-except block?

Just that it went over the 80-column limit :-)

Also, I know about asking forgiveness rather than permission, but Florent's 
change doesn't make clear the intent to call current_process only if 
multiprocessing has already been imported (i.e. is in sys.modules). In other 
words, he would catch both the KeyError and any error due to an incomplete 
import of multiprocessing. While either version will work, the way I have it 
preserves the original intent and only traps errors due to multiprocessing 
being incompletely imported.

----------

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

Reply via email to