[Bf-blender-cvs] [c9291ab2ac1] master: Use for/else instead of setting 'ok' variable.
Sybren A. Stüvel
noreply at git.blender.org
Mon Jun 19 15:29:49 CEST 2017
Commit: c9291ab2ac11a169244fc5c815e683a7b36a9bb8
Author: Sybren A. Stüvel
Date: Mon Jun 19 15:25:58 2017 +0200
Branches: master
https://developer.blender.org/rBc9291ab2ac11a169244fc5c815e683a7b36a9bb8
Use for/else instead of setting 'ok' variable.
This is more efficient, and this use case is exactly what the else clause
is for.
===================================================================
M tests/python/bl_load_py_modules.py
===================================================================
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))
More information about the Bf-blender-cvs
mailing list