diff options
| author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-10 17:24:35 +0200 |
|---|---|---|
| committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-10 17:24:35 +0200 |
| commit | 596b43381711248093caf1c1df3b5d93d0c70bb6 (patch) | |
| tree | 050cf1488a5ffc169cef99192b8027e50406453d | |
| parent | a2036385273efd0ca993d04a6f87dc7d05306717 (diff) | |
| download | psutil-596b43381711248093caf1c1df3b5d93d0c70bb6.tar.gz | |
fix re, fix, flake 8, give CREDITS to @ygingras for #1057
| -rw-r--r-- | CREDITS | 4 | ||||
| -rw-r--r-- | psutil/_pslinux.py | 5 |
2 files changed, 7 insertions, 2 deletions
@@ -468,3 +468,7 @@ W: https://github.com/alexanha N: Himanshu Shekhar W: https://github.com/himanshub16 I: 1036 + +N: Yannick Gingras +W: https://github.com/ygingras +I: 1057 diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index f834f19f..7c075f41 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -1677,7 +1677,8 @@ class Process(object): raise @wrap_exceptions - def num_ctx_switches(self, _ctxsw_re=re.compile(br'ctxt_switches:\t(\d+)')): + def num_ctx_switches(self, + _ctxsw_re=re.compile(br'ctxt_switches:\t(\d+)')): data = self._read_status_file() ctxsw = _ctxsw_re.findall(data) if not ctxsw: @@ -1690,7 +1691,7 @@ class Process(object): return _common.pctxsw(int(ctxsw[0]), int(ctxsw[1])) @wrap_exceptions - def num_threads(self, _num_threads_re=re.compile(br'hreads:\t(\d+)')): + def num_threads(self, _num_threads_re=re.compile(br'Threads:\t(\d+)')): # Note: on Python 3 using a re is faster than iterating over file # line by line. On Python 2 is the exact opposite, and iterating # over a file on Python 3 is slower than on Python 2. |
