Hyper-V: Remove useless use of "else" clause on for loop

"else" on for loops is only important if the loop contains a "break"
statement.  Without a "break", the else block is _always_ executed and
it is clearer just to omit "else".

This change also enables the corresponding pylint warning, now that the
only offending case has been fixed.

Change-Id: Ibe8761cb40a7d2d564aa718d62c9f383b5ad711e
This commit is contained in:
Angus Lees 2014-08-21 14:08:07 +10:00
parent 1aaa8b3446
commit 105ce10838
2 changed files with 1 additions and 5 deletions

View File

@ -68,7 +68,6 @@ disable=
unused-argument,
unused-import,
unused-variable,
useless-else-on-loop,
# "C" Coding convention violations
bad-continuation,
invalid-name,

View File

@ -51,7 +51,4 @@ class HypervMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
for pattern in mappings:
if re.match(pattern, segment[api.PHYSICAL_NETWORK]):
return True
else:
return False
else:
return False
return False