mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-25 06:26:37 +00:00
Regex and syntax tweaks
I didn't pay close enough attention to the try grammar.
This commit is contained in:
parent
36b395ae30
commit
ba0d5ab285
@ -28,16 +28,15 @@ class DatabaseWrapper(base.DatabaseWrapper):
|
|||||||
|
|
||||||
def _remove_invalid_keyword_argument(self, params):
|
def _remove_invalid_keyword_argument(self, params):
|
||||||
try:
|
try:
|
||||||
prog = re.compile(r"^'(?P<key>[^']+)' is an invalid keyword argument for Connection[()]{2}$")
|
prog = re.compile(r"^(?P<quote>['])(?P<key>[^']+)(?P=quote) is an invalid keyword argument for Connection\(\)$")
|
||||||
match = prog.match(e.args[0])
|
match = prog.match(e.args[0])
|
||||||
else:
|
|
||||||
if match:
|
if match:
|
||||||
key = match.group('key')
|
key = match.group('key')
|
||||||
try:
|
try:
|
||||||
# remove the invalid keyword argument
|
# remove the invalid keyword argument
|
||||||
del params[key]
|
del params[key]
|
||||||
else:
|
return True
|
||||||
return True
|
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user