diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-06-19 16:25:58 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2017-06-19 16:28:52 +0300 |
commit | c9291ab2ac11a169244fc5c815e683a7b36a9bb8 (patch) | |
tree | 951e966b62b7d080cb56e60a575d35e5c8403c61 /tests | |
parent | 9af3119c531e1b09578871025abf210fd879e063 (diff) |
Use for/else instead of setting 'ok' variable.
This is more efficient, and this use case is exactly what the else clause
is for.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/python/bl_load_py_modules.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/python/bl_load_py_modules.py b/tests/python/bl_load_py_modules.py index c13679d16f0..5908ba14718 100644 --- a/tests/python/bl_load_py_modules.py +++ b/tests/python/bl_load_py_modules.py @@ -211,11 +211,10 @@ def load_modules(): [(os.sep + f + ".py") for f in BLACKLIST]) for f in source_files: - ok = False for ignore in ignore_paths: if ignore in f: - ok = True - if not ok: + break + else: raise Exception("Source file %r not loaded in test" % f) print("loaded %d modules" % len(loaded_files)) |