Skip to content

Commit

Permalink
Fixed bug in arg passing in decorators._use_multip_worker; version no…
Browse files Browse the repository at this point in the history
…w 0.2.2
  • Loading branch information
zachbateman committed Feb 13, 2019
1 parent 3d2f719 commit 797025c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions easy_multip/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ def inner(*args, **kwargs):
return inner


def _use_multip_worker(func, sublist, cpu_index, working_dict, *args):
def _use_multip_worker(func, sublist, cpu_index, working_dict, *args_kwargs):
'''
This worker function must be at the top-level of this module
so that it can be pickled for multiprocessing.
'''
args, kwargs = args # both are coming in as *args
working_dict[cpu_index] = func(sublist, args[0], args[1], **kwargs)
args, kwargs = args_kwargs # both are coming in as *args
working_dict[cpu_index] = func(sublist, *args, **kwargs)
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
long_description = f.read()

setup(name='easy_multip',
version='0.2.1',
version='0.2.2',
packages=['easy_multip'],
license='MIT',
author='Zach Bateman',
description='Easy Python multiprocessing',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/zachbateman/easy_multip.git',
download_url='https://github.com/zachbateman/easy_multip/archive/v_0.2.1.tar.gz',
download_url='https://github.com/zachbateman/easy_multip/archive/v_0.2.2.tar.gz',
keywords=['MULTIPROCESSING', 'SIMPLE', 'EASY', 'PARALLEL'],
install_requires=['tqdm'],
classifiers=['Development Status :: 3 - Alpha',
Expand Down
2 changes: 1 addition & 1 deletion tests/decorator_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# decorated with "use_multip" below definition (can't use @ sugar b/c pickle issues)
def test_func(list_arg: list, arg2, arg3, add=True):
'''
Function that takes first arg as list and returns a list or None.
Takes first arg as list and returns a list or None.
'''
results = []
for x in list_arg:
Expand Down

0 comments on commit 797025c

Please sign in to comment.