Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #85283

Re: multiprocessing.Queue() and missing sem_open

References <877fvwaz1y.fsf@news.ole.ath.cx> <mailman.18497.1423175353.18130.python-list@python.org> <ytz8ugbo36u.fsf@news.ole.ath.cx>
Date 2015-02-06 19:34 +1100
Subject Re: multiprocessing.Queue() and missing sem_open
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.18504.1423211656.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Feb 6, 2015 at 7:27 PM, Оlе Ѕtrеісhеr <ole-usenet-spam@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

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

multiprocessing.Queue() and missing sem_open ole-usenet-spam@gmx.net (Оlе Ѕtrеісhеr) - 2015-02-05 21:22 +0100
  Re: multiprocessing.Queue() and missing sem_open Chris Angelico <rosuav@gmail.com> - 2015-02-06 09:29 +1100
    Re: multiprocessing.Queue() and missing sem_open ole-usenet-spam@gmx.net (Оlе Ѕtrеісhеr) - 2015-02-06 09:27 +0100
      Re: multiprocessing.Queue() and missing sem_open Chris Angelico <rosuav@gmail.com> - 2015-02-06 19:34 +1100

csiph-web