[Python-modules-commits] [epsilon] 06/15: Gracefully handle not finding working directory.

Tristan Seligmann mithrandi at moszumanska.debian.org
Sat Oct 10 15:45:39 UTC 2015


This is an automated email from the git hooks/post-receive script.

mithrandi pushed a commit to branch master
in repository epsilon.

commit 2569a96a45b18c134991a8e2166dadbe7c432e84
Author: Tristan Seligmann <mithrandi at debian.org>
Date:   Sat Oct 10 16:52:24 2015 +0200

    Gracefully handle not finding working directory.
    
    There are various situations where epsilon.benchmark may be unable to
    find the working directory in /proc/self/mounts; this patch makes the
    code handle this gracefully, like the case where the device cannot be
    found in /proc/diskstats.
    
    Forwarded: no
---
 epsilon/scripts/benchmark.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/epsilon/scripts/benchmark.py b/epsilon/scripts/benchmark.py
index ae5f4aa..a30f53b 100644
--- a/epsilon/scripts/benchmark.py
+++ b/epsilon/scripts/benchmark.py
@@ -428,7 +428,9 @@ def discoverCurrentWorkingDevice():
         if cwd.startswith(parts[1]):
             possibilities.append((len(parts[1]), parts[0]))
     possibilities.sort()
-    return possibilities[-1][-1]
+    if len(possibilities) > 0:
+        return possibilities[-1][-1]
+    return ''
 
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/epsilon.git



More information about the Python-modules-commits mailing list