Improved error message on connect when kwargs are passed together with dns

This commit is contained in:
Daniele Varrazzo 2012-09-26 11:47:06 +01:00
parent cd316a94f1
commit cf3c6f86ff

View File

@ -165,9 +165,8 @@ def connect(dsn=None,
if dsn is not None and items: if dsn is not None and items:
raise InterfaceError( raise InterfaceError(
"you cannot specify keyword arguments (%s)" "'%s' is an invalid keyword argument when the dsn is specified"
" together with a connection string" % items[0][0])
% ", ".join([k for k, v in items]))
if dsn is None: if dsn is None:
if not items: if not items: