@@ -15,15 +15,15 @@ class DatabaseTransport(XmlServiceTransport):
15
15
to use
16
16
**kwargs: Base transport options. See `XmlServiceTransport`.
17
17
"""
18
- def __init__ (self , conn , * args , schema = 'QXMLSERV' , * *kwargs ):
19
- # TODO: When we drop Python 2 support, change *args to * and
20
- # remove this block of code. *args is used to make schema
21
- # a keyword-only argument
22
- if len ( args ) :
23
- raise TypeError (
24
- "__init__() takes 1 positional argument, but {} were given"
25
- . format ( len ( args ) + 1 )
26
- )
18
+ def __init__ (self , conn , ** kwargs ):
19
+ # TODO: When we drop Python 2 support, add `*, schema='QXMLSERV'`
20
+ # to the function variables, to make schema a keyword-only argument
21
+ # and remove this block of code
22
+ if 'schema' in kwargs :
23
+ schema = kwargs [ 'schema' ]
24
+ del kwargs [ 'schema' ]
25
+ else :
26
+ schema = 'QXMLSERV'
27
27
28
28
if not hasattr (conn , 'cursor' ):
29
29
raise ValueError (
@@ -36,9 +36,9 @@ def __init__(self, conn, *args, schema='QXMLSERV', **kwargs):
36
36
37
37
self .conn = conn
38
38
39
+ self .procedure = "iPLUGR512K"
39
40
if schema :
40
- self .procedure = schema + "."
41
- self .procedure += "iPLUGR512K"
41
+ self .procedure = schema + "." + self .procedure
42
42
43
43
# We could simplify to just using execute, since we don't care
44
44
# about output parameters, but ibm_db throws weird errors when
0 commit comments