multiprocessing.Queue() and missing sem_open

Chris Angelico rosuav at gmail.com
Fri Feb 6 03:34:08 EST 2015


On Fri, Feb 6, 2015 at 7:27 PM, Оlе Ѕtrеісhеr <ole-usenet-spam at gmx.net> wrote:
>> the AttributeError will come from the attribute lookup - the above code
>> can't[1] bomb out with ImportError.
>
> Maybe it can't but it actually does.

Huh. Okay, my bad. (I don't have a Hurd system to test on, all my
Debians are Linux.) Sorry for the misinformation.

>> So a more correct way would be something like:
>>
>> try:
>>     import multiprocessing
>>     multiprocessing.Queue
>> except (ImportError, AttributeError):
>>     # handle the absence
>
> Is it sure that this will work in the future as well?

Frankly, I don't know now. It's reasonably likely that it will, but in
the absence of actual documentation, I couldn't say.

ChrisA



More information about the Python-list mailing list