Require python 3.7+ We've specified this requirement for a while; enforce it before the release.
Drop vestigial compat.items Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
Drop vestigial comapt.int_types Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
Drop vestigial compat.str_type Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
Drop vestigial compat.range Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
Drop vestigial compat.input Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
Drop vestigial compat.ModuleNotFound Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
Drop support for python 2 Don't make broad, disruptive changes for now, but disallow python 2 in ./configure, adjust the docs, and remove code where it's unlikely to cause conflicts with other pending changes. Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
Detect failures to explicitly close mmaps in py3 too ...since they're expensive, and the wrapper has detected issues a number of times. Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
Add compat.mmap.close to set _bup_closed and always inititalize it Add a compat.mmap.close method that properly maintains the _bup_closed value, and make sure it always exists. Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
Check that all context managed objects are properly closed Ensure all of our context managed objects have a __del__ that asserts that the instance has been properly closed so that we'll be more likely to notice related oversights. This will only work in cases where __del__ is called before shutdown, but that should normally be the case for cpython. Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
compat: add ExitStack For now, just add enough py2 support (since it wasn't too hard) to handle some forthcoming cases. Signed-off-by: Rob Browning <rlb@defaultvalue.org>
compat.mmap: add py2 context management and use everywhere It looks like py2 doesn't support mmap __enter__ and __exit__, so add them, and switch all our mmap instances to be compat.mmap so that we'll be able to context manage them. Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
Remove Client __del__ in favor of context management And drop EPIPE suppression for now. Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
compat.pending_raise: allow/ignore None ex; make rethrow optional This supports compact __exit__ handlers, e.g. def __exit__(self, type, value, ...): with pending_raise(value, rethrow=False): clean_up() Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
pylint: add undefined-variable Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Rob Browning <rlb@defaultvalue.org> [rlb@defaultvalue.org: add missing %s in validate_vfs_path changes] Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
pylint: enable useless-return Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
test: add pylint and test imports Add pylint and test for unnecessary imports as a first step, which requires cleaning them all up. [rlb@defaultvalue.org: add and use ./pylint] Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Reviewed-by: Rob Browning <rlb@defaultvalue.org> Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>
Convert top level executables to binaries and clean up clean Signed-off-by: Rob Browning <rlb@defaultvalue.org>
compat: add "with pending_raise(ex)" to simplify nested exceptions Thanks to Johannes Berg for the suggesting the approach. Signed-off-by: Rob Browning <rlb@defaultvalue.org> Tested-by: Rob Browning <rlb@defaultvalue.org>