From b06d1dae4222cdb6e50fef629967bc76625b52e9 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Wed, 23 Nov 2022 10:48:39 +0000 Subject: Convert.format() to f-strings with flynt --- dump.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dump.py') diff --git a/dump.py b/dump.py index 4464823..4b8c395 100644 --- a/dump.py +++ b/dump.py @@ -46,11 +46,11 @@ def _iterdump(connection): # qtable, # sql.replace("''"))) else: - yield('{0};'.format(sql)) + yield(f'{sql};') # Build the insert statement for each row of the current table table_name_ident = table_name.replace('"', '""') - res = cu.execute('PRAGMA table_info("{0}")'.format(table_name_ident)) + res = cu.execute(f'PRAGMA table_info("{table_name_ident}")') column_names = [str(table_info[1]) for table_info in res.fetchall()] q = """SELECT 'INSERT INTO "{0}" VALUES({1})' FROM "{0}";""".format( table_name_ident, @@ -68,6 +68,6 @@ def _iterdump(connection): """ schema_res = cu.execute(q) for name, type, sql in schema_res.fetchall(): - yield('{0};'.format(sql)) + yield(f'{sql};') yield('COMMIT;') \ No newline at end of file -- cgit v1.2.3