Dec-29-2018, 10:27 PM
Porting my 2.7 code to python 3.6.7
Two confusing issues:
1. 2to3 found changes on second run.
After running 2to3 on a dir so changes are made, tested, and committed, I run it again latter to check and it found new changes.
Now it wants to add 'list' to all previous changes of '.iteritems()' to 'items()'
I understand why from my research, but why did it not make the change the first time? I can reproduce this behavior every time.
e.g.
2. output of 2to3 seems to say no changes needed but then gives list of files to be modified.
After running twice 2to3 on a dir so all needed changes are made, tested, and committed, I run it again latter to check and this output like this (note bold):
If I run a third time with the -w option no changes are made. It seems this output is misleading, right?
Two confusing issues:
1. 2to3 found changes on second run.
After running 2to3 on a dir so changes are made, tested, and committed, I run it again latter to check and it found new changes.
Now it wants to add 'list' to all previous changes of '.iteritems()' to 'items()'
I understand why from my research, but why did it not make the change the first time? I can reproduce this behavior every time.
e.g.
Quote:
- for k,v in self.all_devices.items():
+ for k,v in list(self.all_devices.items()):
2. output of 2to3 seems to say no changes needed but then gives list of files to be modified.
After running twice 2to3 on a dir so all needed changes are made, tested, and committed, I run it again latter to check and this output like this (note bold):
Quote:$ 2to3 *py
RefactoringTool: Skipping optional fixer: buffer
RefactoringTool: Skipping optional fixer: idioms
RefactoringTool: Skipping optional fixer: set_literal
RefactoringTool: Skipping optional fixer: ws_comma
RefactoringTool: No changes to DeviceMap.py
RefactoringTool: No changes to DeviceMapSnmp.py
RefactoringTool: No changes to SnmpSensor.py
RefactoringTool: No changes to SnmpSensors.py
RefactoringTool: Files that need to be modified:
RefactoringTool: DeviceMap.py
RefactoringTool: DeviceMapSnmp.py
RefactoringTool: SnmpSensor.py
RefactoringTool: SnmpSensors.py
If I run a third time with the -w option no changes are made. It seems this output is misleading, right?