[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
Please register or sign in to comment