We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7a53c61 + b42e5a5 commit dde9db8Copy full SHA for dde9db8
rdflib/plugins/stores/sparqlconnector.py
@@ -52,8 +52,10 @@ def __init__(
52
self.kwargs = kwargs
53
self.method = method
54
if auth is not None:
55
- assert type(auth) == tuple, "auth must be a tuple"
56
- assert len(auth) == 2, "auth must be a tuple (user, password)"
+ if type(auth) != tuple:
+ raise SPARQLConnectorException("auth must be a tuple")
57
+ if len(auth) != 2:
58
+ raise SPARQLConnectorException("auth must be a tuple (user, password)")
59
base64string = base64.b64encode(bytes('%s:%s' % auth, 'ascii'))
60
self.kwargs.setdefault("headers", {})
61
self.kwargs["headers"].update({"Authorization": "Basic %s" % base64string.decode('utf-8')})
0 commit comments