diff --git a/tubesync/tubesync/sqlite3/base.py b/tubesync/tubesync/sqlite3/base.py index e4dfbcb8..bee1b3f4 100644 --- a/tubesync/tubesync/sqlite3/base.py +++ b/tubesync/tubesync/sqlite3/base.py @@ -28,16 +28,15 @@ class DatabaseWrapper(base.DatabaseWrapper): def _remove_invalid_keyword_argument(self, params): try: - prog = re.compile(r"^'(?P[^']+)' is an invalid keyword argument for Connection[()]{2}$") + prog = re.compile(r"^(?P['])(?P[^']+)(?P=quote) is an invalid keyword argument for Connection\(\)$") match = prog.match(e.args[0]) - else: - if match: - key = match.group('key') - try: - # remove the invalid keyword argument - del params[key] - else: - return True + + if match: + key = match.group('key') + try: + # remove the invalid keyword argument + del params[key] + return True return False