Check for value error caused by no valid files found with files_changed

This causes an infinite loop when in auto-reload
Fix #467
Fix #451
Fix #443
This commit is contained in:
tBunnyMan 2012-08-23 11:05:07 -07:00
commit 86da6d1f2e
2 changed files with 22 additions and 5 deletions

View file

@ -241,10 +241,14 @@ def files_changed(path, extensions):
yield os.stat(os.path.join(root, f)).st_mtime
global LAST_MTIME
mtime = max(file_times(path))
if mtime > LAST_MTIME:
LAST_MTIME = mtime
return True
try:
mtime = max(file_times(path))
if mtime > LAST_MTIME:
LAST_MTIME = mtime
return True
except ValueError:
logger.info("No files found in path")
return False
return False