diff options
author | Lars Wirzenius <liw@liw.fi> | 2013-11-06 20:50:01 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2013-11-06 20:50:01 +0000 |
commit | 97b3adc2c66b4d5c97746ade76352c8d00727474 (patch) | |
tree | 5bee511284e4699932d72d3f61702febeed3423c /cliapp/app.py | |
parent | 4a568347f21f4db1ce79e17fe29abc7d8c6ba585 (diff) | |
download | cliapp-97b3adc2c66b4d5c97746ade76352c8d00727474.tar.gz |
Avoid crash if /proc/self/status doesn't exist
Diffstat (limited to 'cliapp/app.py')
-rw-r--r-- | cliapp/app.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cliapp/app.py b/cliapp/app.py index 84bd64d..3b63b75 100644 --- a/cliapp/app.py +++ b/cliapp/app.py @@ -640,7 +640,10 @@ class Application(object): '''Return current resident memory use, in KiB.''' if platform.system() != 'Linux': return 0 - f = open('/proc/self/status') + try: + f = open('/proc/self/status') + except IOError: + return 0 rss = 0 for line in f: if line.startswith('VmRSS'): |