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

Make psutil.STATUS_* constants str comparable #282

Closed
giampaolo opened this issue May 23, 2014 · 3 comments
Closed

Make psutil.STATUS_* constants str comparable #282

giampaolo opened this issue May 23, 2014 · 3 comments

Comments

@giampaolo
Copy link
Owner

From g.rodola on June 13, 2012 15:58:56

Now that we've introduced Process.as_dict() method ( issue 278 ) a typical 
usage one might face is to serialize the returned dict.
When that's done, process status gets automatically turned into a string due 
to: 
https://code.google.com/p/psutil/source/browse/tags/release-0.4.1/psutil/_common.py#27
 That makes it impossible to compare the serialized status value (which is a 
string) with the base STATUS_* constants (which are derived from int but 
doesn't check for equality with the string).
Proposal  
is to override constant.__eq__ method in order to use both int or str values 
when comparing for equality.

Original issue: http://code.google.com/p/psutil/issues/detail?id=282

@giampaolo giampaolo self-assigned this May 23, 2014
@giampaolo
Copy link
Owner Author

From g.rodola on June 13, 2012 07:05:10

Fixed in r1344 .

Status: FixedInSVN
Cc: [email protected]

@giampaolo
Copy link
Owner Author

From g.rodola on June 27, 2012 11:54:03

0.5.0 is finally out. Closing out as fixed.

Status: Fixed

@giampaolo
Copy link
Owner Author

From g.rodola on March 02, 2013 04:09:05

Updated csets after the SVN -> Mercurial migration: r1344 == revision ???

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