Skip to content
This repository has been archived by the owner on Jan 21, 2018. It is now read-only.

Exception when pattern in folder_exclude_patterns not found #29

Open
niecw opened this issue Jul 11, 2012 · 0 comments
Open

Exception when pattern in folder_exclude_patterns not found #29

niecw opened this issue Jul 11, 2012 · 0 comments

Comments

@niecw
Copy link

niecw commented Jul 11, 2012

When the folder_exclude_patterns is set with something that is not found, it will generate the following Traceback:

  File "./todo.py", line 289, in run
  File "./todo.py", line 226, in format
  File "./todo.py", line 169, in extract
  File "./todo.py", line 155, in filter_files
  File "./todo.py", line 143, in iter_files
ValueError: list.remove(x): x not in list

The following patch if applied to todo.py seems to "cure' it:

@@ -140,7 +140,7 @@
                 ## remove excluded dirs
                 for dir in [dir for dir in exclude_dirs if dir in dirnames]:
                     self.log.debug('Ignoring dir: {0}'.format(dir))
-                    dirnames.remove(dir)
+                    (dir in dirnames) and dirnames.remove(dir)

                 for filepath in filenames:
                     pth = path.join(dirpath, filepath)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant