diff options
author | Walter Bender <walter@sugarlabs.org> | 2014-02-13 14:07:30 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2014-02-13 14:07:30 (GMT) |
commit | d0c0d27a35a6c67c9dcc44b3f997a442488f4ad9 (patch) | |
tree | d7c4776168468eaadab34078fb70fff25f056a7d | |
parent | 573092ed319a604a0c3426f374b2ceee7843201f (diff) |
check path exists before doing listdir
-rw-r--r-- | library/pippy/sound.py | 2 | ||||
-rw-r--r-- | sound_check.py | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/library/pippy/sound.py b/library/pippy/sound.py index fe6c1b0..2006f68 100644 --- a/library/pippy/sound.py +++ b/library/pippy/sound.py @@ -47,6 +47,8 @@ def finddir(): sound_candidate_dirs = None for path in paths: + if not os.path.exists(path): + continue for f in os.listdir(path): if f in ['TamTamMini.activity', 'TamTamJam.activity', 'TamTamEdit.activity', 'TamTamSynthLab.activity', diff --git a/sound_check.py b/sound_check.py index 79ec267..dd8f4d1 100644 --- a/sound_check.py +++ b/sound_check.py @@ -33,6 +33,8 @@ def finddir(): sound_candidate_dirs = None for path in paths: + if not os.path.exists(path): + continue for f in os.listdir(path): if f in ['TamTamMini.activity', 'TamTamJam.activity', 'TamTamEdit.activity', 'TamTamSynthLab.activity', |