Code review comment for lp://staging/~ogra/xdiagnose/py3port

Revision history for this message
Colin Watson (cjwatson) wrote :

- for k, r in codes.items():
+ for k, r in list(codes.items()):

This is just 2to3 being conservative; you don't actually need the list() here, since the body of the loop doesn't modify codes.

+ dates = list(dates.keys())
  dates.sort()
  return dates

Simpler: "return sorted(dates)"

+ pkgs = list(dpkg_events.keys())
  pkgs.sort()
  for pkg in pkgs:

"for pkg in sorted(dpkg_events):"

+ print(device.name, device.regex, end=' ')
...

Doesn't this end up writing double spaces sometimes (e.g. in the "NOT SUPPORTED" case)? I'd have been inclined to use end=''.

The rest looks fine to me, although I'd have been inclined to add print_function and absolute_import imports from __future__ as applicable just in case there's a need to revert the #! to /usr/bin/python for some reason.

review: Approve

« Back to merge proposal