Fix removal of invalid directories in import test

This commit is contained in:
Kovid Goyal 2019-04-10 20:46:12 +05:30
parent 63f1996b5f
commit 50dd4952cb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -34,7 +34,7 @@ class TestImports(unittest.TestCase):
import_base = os.path.dirname(base)
count = 0
for root, dirs, files in os.walk(base):
for d in dirs:
for d in tuple(dirs):
if not os.path.isfile(os.path.join(root, d, '__init__.py')):
dirs.remove(d)
for fname in files: