Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process.cpu_affinity() should accept a set() (or other iterables) #589

Closed
giampaolo opened this issue Feb 9, 2015 · 1 comment
Closed

Comments

@giampaolo
Copy link
Owner

~/svn/psutil {master}$ python -c "import psutil; psutil.Process().cpu_affinity(set([0]))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "psutil/__init__.py", line 702, in cpu_affinity
    self._proc.cpu_affinity_set(cpus)
  File "psutil/_pslinux.py", line 649, in wrapper
    return fun(self, *args, **kwargs)
  File "psutil/_pslinux.py", line 961, in cpu_affinity_set
    cext.proc_cpu_affinity_set(self.pid, cpus)
TypeError: sequence argument expected, got set

This is kind of related to #525. Since in #525 we're going to return a set it is better for cpu_affinity() (set) to also accept a set or any other iterable.

@giampaolo giampaolo added the bug label Feb 9, 2015
@giampaolo giampaolo changed the title Process.get_cpu_affinity() should accept a set() (or other iterables) Process.cpu_affinity() should accept a set() (or other iterables) Feb 9, 2015
@giampaolo giampaolo added enhancement and removed bug labels Feb 9, 2015
@giampaolo
Copy link
Owner Author

Fixed in 4320a32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant