-
Committer:
Dan Ryan
-
Date:
2020-01-22 01:16:37 UTC
-
mto:
This revision was merged to the branch mainline in
revision
528.
-
Revision ID:
dan.ryan@canonical.com-20200122011637-8478ranlwe8ee90c
- Convert print statements -> print functions
- Add __future__ imports to ensure compatible behavior
- Convert map() calls to for loops or wrap with list() for compatibility
- Convert execption.message invocations to str(exception)
- Convert absolute to relative imports and fix implicit relative imports
- Fix calls to non-existent `NotImplemented` -> `NotImplementedError`
- Remove mutable argument defaults from function definitions and prefer setting them in function body
- Avoid returning `x.keys()` -> return `list(x.keys()), avoid calling `x.iteritems()` -> prefer `x.items()`
- Ensure shebangs are positioned as first line of files
- Remove all imports and uses of now removed `commands` module -> prefer `subprocess.check_output`,
piping `stderr` to `subprocess.STDOUT` and handling `subprocess.CalledProcessError` to set status codes on failure
- Prefer `universal_newlines` to ensure text-type output on python 3
- Convert file modes from integer to octal
- Use `six` compatibility shims for `input`, `range`