vterron / lemon

Differential photometry for humans (and astronomers)
64 stars 21 forks source link

Bugfix: multiprocessing queue doesn't pickle _size #107

Open kinland opened 4 years ago

kinland commented 4 years ago

I needed to make these small changes in order to get queue working with my multiprocessing code in python 3.6+.

There were two issues:

  1. multiprocessing.queues.Queue.__init__ takes a ctx argument, which was not provided
  2. if you are using spawn rather than fork with multiprocessing (e.g. running on Windows), _size doesn't get pickled, and get/put/etc will throw an AttributeError about there being no such attribute
vterron commented 4 years ago

Thanks for contributing this! Please see my comments.

kinland commented 4 years ago

Sorry about the delay! I've made the requested changes. (Edit: and fixed the missing import. Sorry about that.)