Skip to content

Commit dfd80d5

Browse files
committed
🦺 improve condition checks for MySQL table exclusions in CLI
1 parent 2682bbc commit dfd80d5

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/mysql_to_sqlite3/cli.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def cli(
199199
"Error: Both -Z/--without-tables and -W/--without-data are set. There is nothing to do. Exiting..."
200200
)
201201

202-
if mysql_tables and exclude_mysql_tables:
202+
if mysql_tables is not None and exclude_mysql_tables is not None:
203203
raise click.UsageError("Illegal usage: --mysql-tables and --exclude-mysql-tables are mutually exclusive!")
204204

205205
converter = MySQLtoSQLite(
@@ -212,11 +212,7 @@ def cli(
212212
limit_rows=limit_rows,
213213
collation=collation,
214214
prefix_indices=prefix_indices,
215-
without_foreign_keys=without_foreign_keys
216-
or (
217-
(mysql_tables is not None and len(mysql_tables) > 0)
218-
or (exclude_mysql_tables is not None and len(exclude_mysql_tables) > 0)
219-
),
215+
without_foreign_keys=without_foreign_keys or bool(mysql_tables) or bool(exclude_mysql_tables),
220216
without_tables=without_tables,
221217
without_data=without_data,
222218
mysql_host=mysql_host,

0 commit comments

Comments
 (0)