I am trying to get 4-5 signed-off-by people on a small patch for a python script that lives in the scripts directory of the kernel source. If a handful of people from the python team or who others who really know python would not mind taking a look at the patch that would be great. I welcome any constructive criticism.
My goal was to get the patch 2.7 / 3.X compatible. It should apply against most of the later kernels, as this script has not changed in awhile.
Thanks,
Mike
Update:
Guys, please take a look at the newest patch, I have incorporated the suggested changes.
A few things:
– Don’t use “a” and “b”, use config_a or something similar.
– Drop the spaces in in front of ( for the print statements.
– The IOError Except block should state the error:
try:
…
except IOError as e:
sys.stderr.write(“…” % e)
…
Otherwise, an unreadable file (due to, say, permissions) will yield an unhelpful message
– The last change (adding list() around b.keys()) doesn’t make much sense to me, what’s the point?
For the print you could use the print_function in __future__, but this requires python 2.6+. For the last part you could write in the modern style: new = sorted(b.keys()).
@Blackb|rd – thanks! I’ll incorporate your changes and probably bug you again. 🙂
@Ewoud – thanks, also. I’ll take a look at your suggestions.
Appreciate the look, guys.