Skip to content
Commit 299a4dc1 authored by Nicolas Gattolin's avatar Nicolas Gattolin Committed by Romain Bignon
Browse files

[cmso] fixed a code smell (py3 port)

The lines "keys = ..." and "contacts = ..." execute in py2 but not in py3.
Reason is: this code relies (not on pupose I think) on a feature
that is implementation-specific (CPython 2.X): the leak of for loop
iteration variables in local scope, thus permitting use of those variables after loop finished.

In addition, the first line initializes a variable that shadows an
existing non-local variable.

This code magically worked for 2 years. But as Python3.X removes this
specificity, this code is no longer valid.

Blind fixes used:
- replace keys local variable with keys_
- change order of loop nesting to have fonctionnaly equivalent but
functional code
parent 6b196229
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment