)]}'
{"swift/container/backend.py":[{"author":{"_account_id":1179,"name":"Clay Gerrard","email":"clay.gerrard@gmail.com","username":"clay-gerrard"},"change_message_id":"095cb464582c0855d5474ba1af61eadc0ba2961e","unresolved":false,"context_lines":[{"line_number":1661,"context_line":"        except sqlite3.OperationalError as err:"},{"line_number":1662,"context_line":"            if (\u0027no such table: %s\u0027 % SHARD_RANGE_TABLE) not in str(err):"},{"line_number":1663,"context_line":"                raise"},{"line_number":1664,"context_line":"            return []"},{"line_number":1665,"context_line":""},{"line_number":1666,"context_line":"    @classmethod"},{"line_number":1667,"context_line":"    def resolve_shard_range_states(cls, states):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_c4cbcc50","line":1664,"updated":"2018-05-22 20:28:47.000000000","message":"i think you can collapse this a bit...\n\n    diff --git a/swift/container/backend.py b/swift/container/backend.py\n    index 69ea59f..3990772 100644\n    --- a/swift/container/backend.py\n    +++ b/swift/container/backend.py\n    @@ -1653,11 +1653,8 @@ class ContainerBroker(DatabaseBroker):\n                 return [row for row in data]\n     \n             try:\n    -            if connection:\n    +            with connection or self.get() as connection:\n                     return do_query(connection)\n    -            else:\n    -                with self.get() as conn:\n    -                    return do_query(conn)\n             except sqlite3.OperationalError as err:\n                 if (\u0027no such table: %s\u0027 % SHARD_RANGE_TABLE) not in str(err):\n                     raise\n\n\nstill readable I think?","commit_id":"f68dd3bf10ceae6ea4dae484e5c8ce8a6e27a678"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"af7910a8fabae5ab405c43f5ed6dbd84e6981493","unresolved":false,"context_lines":[{"line_number":1661,"context_line":"        except sqlite3.OperationalError as err:"},{"line_number":1662,"context_line":"            if (\u0027no such table: %s\u0027 % SHARD_RANGE_TABLE) not in str(err):"},{"line_number":1663,"context_line":"                raise"},{"line_number":1664,"context_line":"            return []"},{"line_number":1665,"context_line":""},{"line_number":1666,"context_line":"    @classmethod"},{"line_number":1667,"context_line":"    def resolve_shard_range_states(cls, states):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_048304ce","line":1664,"in_reply_to":"5f7c97a3_c4cbcc50","updated":"2018-05-22 20:39:43.000000000","message":"Does connection provide __enter__/__exit__? If it *does*, is that what we *want*? Might need like\n\n class wrapper(object):\n     def __init__(self, wrapped):\n         self.wrapped \u003d wrapped\n     def __bool__(self):\n         return bool(self.wrapped)\n     def __enter__(self):\n         return self.wrapped\n     def __exit__(self, *args):\n         pass\n\nso we could do\n\n with wrapper(connection) or self.get() as connection:\n\nBut yeah, this would also be handy over in _populate_instance_cache... maybe worth doing? IDK.","commit_id":"f68dd3bf10ceae6ea4dae484e5c8ce8a6e27a678"}]}
