bundlewrap / bundlewrap

with statements can be merged PTC-W0062
Anti-pattern
Major
2 months ago3 years old
Consider merging collapsible With statements`
339                    getattr(self, "_fix_" + fix_type)(status)
340
341    def _fix_content_hash(self, status):
342        with self._write_local_file() as local_path:343            with io.job(_("{}  {}  uploading to node").format(
344                bold(self.node.name),
345                bold(self.id),
Consider merging collapsible With statements`
246
247
248def get_file_contents(path):
249    with error_context(path=path):250        with open(path, 'rb') as f:
251            content = f.read()
252    return content