Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b81bf30

Browse files
committed
Add logger and fix assertion issue in _export. Also remove not relevant try/except
1 parent 3427c48 commit b81bf30

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

rebirthdb/_export.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,7 @@ def export_table(db, table, directory, options, error_queue, progress_info, sind
335335

336336
except (errors.ReqlTimeoutError, errors.ReqlDriverError):
337337
# connection problem, re-setup the cursor
338-
try:
339-
cursor.close()
340-
except Exception:
341-
pass
342-
338+
cursor.close()
343339
cursor = options.retryQuery(
344340
'backup cursor for %s.%s' %
345341
(db, table), query.db(db).table(table).between(
@@ -479,8 +475,10 @@ def run(options):
479475
all_databases = options.retryQuery('list dbs', query.db_list().filter(query.row.ne('rebirthdb')))
480476
for db_table in options.db_tables:
481477
db, table = db_table
482-
# should not be possible
483-
assert db != 'rebirthdb', "Error: Cannot export tables from the system database: 'rebirthdb'"
478+
479+
if not db == 'rebirthdb':
480+
raise AssertionError('Can not export tables from the system database')
481+
484482
if db not in all_databases:
485483
raise RuntimeError("Error: Database '%s' not found" % db)
486484

rebirthdb/logger.py

Whitespace-only changes.

0 commit comments

Comments
 (0)