summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-08-22 08:44:06 +0100
committerLars Wirzenius <liw@liw.fi>2013-08-22 08:44:06 +0100
commit98cdb82d8ea71c8388848d3ae418a365a323d10b (patch)
tree34b2ccba27176796248771a22a54df7b3cc0ece0
parent25bdeb2ff59433d78bca0f46f61b7c1c463cb6ff (diff)
downloadcliapp-trunk.tar.gz
Disable VmRSS reporting on non-Linux platformstrunk
-rw-r--r--NEWS7
-rw-r--r--cliapp/app.py2
2 files changed, 9 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 86418bb..20ca570 100644
--- a/NEWS
+++ b/NEWS
@@ -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: