FYI: `closing` is superflous around pretty much all built-in types (files, locks, sockets, ...), they come with automatic resource cleanup.