From: Sumit Khanna Date: Fri, 1 Oct 2021 05:34:16 +0000 (+0530) Subject: removed redundant found_table, making self.has_table usage more compact while throwin... X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d5af214a3cc2f098879fc78e564cea540909c1b;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git removed redundant found_table, making self.has_table usage more compact while throwing NoSuchTableError exc --- diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py index 3ccec8eb9b..4c6c6d9396 100644 --- a/lib/sqlalchemy/engine/reflection.py +++ b/lib/sqlalchemy/engine/reflection.py @@ -768,7 +768,6 @@ class Inspector(object): if isinstance(table_name, str): table_name = table_name.decode(dialect.encoding) - found_table = True if self.has_table(table.name) else False cols_by_orig_name = {} for col_d in self.get_columns( @@ -782,7 +781,7 @@ class Inspector(object): cols_by_orig_name, ) - if not found_table: + if not self.has_table(table.name): raise exc.NoSuchTableError(table.name) self._reflect_pk(