diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-08-22 08:44:06 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-08-22 08:44:06 +0100 |
commit | 98cdb82d8ea71c8388848d3ae418a365a323d10b (patch) | |
tree | 34b2ccba27176796248771a22a54df7b3cc0ece0 | |
parent | 25bdeb2ff59433d78bca0f46f61b7c1c463cb6ff (diff) | |
download | cliapp-trunk.tar.gz |
Disable VmRSS reporting on non-Linux platformstrunk
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | cliapp/app.py | 2 |
2 files changed, 9 insertions, 0 deletions
@@ -1,6 +1,13 @@ NEWS for cliapp =============== +Version 1.UNRELEASED +------------------ + +* Portability patch to disable VmRSS reporting on non-Linux platforms. + The code assumed that /proc/self/status exists, but that's only true + on Linux. Patch from Itamar Turner-Trauring. + Version 1.20130808 ------------------ diff --git a/cliapp/app.py b/cliapp/app.py index 8e280af..c397c39 100644 --- a/cliapp/app.py +++ b/cliapp/app.py @@ -609,6 +609,8 @@ class Application(object): def _vmrss(self): # pragma: no cover '''Return current resident memory use, in KiB.''' + if platform.system() != 'Linux': + return 0 f = open('/proc/self/status') rss = 0 for line in f: |