Kelsey Hightower avatar Kelsey Hightower committed 384c378

Fixing #205 -- Issue when trying to remove from list twice.

Comments (0)

Files changed (1)

                         if dir in dirs:
                             dirs.remove(dir)
                     for dir in dirs:
-                        # Don't search in anything that looks like a virtualenv environment
-                        if (os.path.exists(os.path.join(root, dir, 'bin', 'python'))
-                            or os.path.exists(os.path.join(root, dir, 'Scripts', 'Python.exe'))):
-                            dirs.remove(dir)
-                        # Also don't search through tests
-                        if dir == 'test' or dir == 'tests':
+                        # Don't search in anything that looks like a
+                        # virtualenv environment or test suite.
+                        if (os.path.exists(os.path.join(
+                                root, dir, 'bin', 'python')) or
+                            os.path.exists(os.path.join(
+                                root, dir, 'Scripts', 'Python.exe')) or
+                            dir == 'test' or dir == 'tests'):
                             dirs.remove(dir)
                     filenames.extend([os.path.join(root, dir)
                                      for dir in dirs])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.