diff options
author | Giampaolo Rodola' <g.rodola@gmail.com> | 2013-04-11 12:39:23 +0200 |
---|---|---|
committer | Giampaolo Rodola' <g.rodola@gmail.com> | 2013-04-11 12:39:23 +0200 |
commit | caa0de2dffd4c3e3fcedd0e5afaacea5e153d838 (patch) | |
tree | 8e7a4227a42c7f64935359249b6991de0fd5f56d | |
parent | 0b3ba2cffac612225850a3b740f3ca597c1d3200 (diff) | |
download | psutil-caa0de2dffd4c3e3fcedd0e5afaacea5e153d838.tar.gz |
small refactoring
-rw-r--r-- | psutil/__init__.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/psutil/__init__.py b/psutil/__init__.py index f485dcf6..c666eeb7 100644 --- a/psutil/__init__.py +++ b/psutil/__init__.py @@ -191,17 +191,15 @@ class Process(object): AccessDenied exception is raised when retrieving that particular process information. """ - excluded_names = frozenset(['send_signal', 'suspend', 'resume', 'nice' - 'terminate', 'kill', 'wait', 'is_running', - 'as_dict', 'parent', 'get_children']) + excluded_names = set(['send_signal', 'suspend', 'resume', 'nice' + 'terminate', 'kill', 'wait', 'is_running', + 'as_dict', 'parent', 'get_children']) retdict = dict() - for name in set(attrs or dir(self)): + for name in set(attrs or dir(self)) - excluded_names: if name.startswith('_'): continue if name.startswith('set_'): continue - if name in excluded_names: - continue try: attr = getattr(self, name) if callable(attr): |