Use for/else instead of setting 'ok' variable.

This is more efficient, and this use case is exactly what the else clause
is for.
This commit is contained in:
Sybren A. Stüvel 2017-06-19 15:25:58 +02:00
parent 9af3119c53
commit c9291ab2ac

@ -211,11 +211,10 @@ def load_modules():
[(os.sep + f + ".py") for f in BLACKLIST]) [(os.sep + f + ".py") for f in BLACKLIST])
for f in source_files: for f in source_files:
ok = False
for ignore in ignore_paths: for ignore in ignore_paths:
if ignore in f: if ignore in f:
ok = True break
if not ok: else:
raise Exception("Source file %r not loaded in test" % f) raise Exception("Source file %r not loaded in test" % f)
print("loaded %d modules" % len(loaded_files)) print("loaded %d modules" % len(loaded_files))