This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vinay.sajip
Recipients chris.jerdonek, flox, vinay.sajip
Date 2010-03-22.18:45:43
SpamBayes Score 5.3748713e-06
Marked as misclassified No
Message-id <271520.40101.qm@web25807.mail.ukl.yahoo.com>
In-reply-to <1269281977.25.0.784769895838.issue8200@psf.upfronthosting.co.za>
Content
----- 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.
History
Date User Action Args
2010-03-22 18:45:45vinay.sajipsetrecipients: + vinay.sajip, flox, chris.jerdonek
2010-03-22 18:45:43vinay.sajiplinkissue8200 messages
2010-03-22 18:45:43vinay.sajipcreate