summaryrefslogtreecommitdiff
path: root/test/osinfo.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/osinfo.py')
-rw-r--r--test/osinfo.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/osinfo.py b/test/osinfo.py
index 04855fe6..25c3a7c6 100644
--- a/test/osinfo.py
+++ b/test/osinfo.py
@@ -45,8 +45,10 @@ elif sys.platform == 'linux2':
try:
# get pseudo file /proc/<pid>/status
t = open('/proc/%d/status' % os.getpid())
- v = t.read()
- t.close()
+ try:
+ v = t.read()
+ finally:
+ t.close()
except IOError:
return 0 # non-Linux?
# get VmKey line e.g. 'VmRSS: 9999 kB\n ...'