Database not connected when using namespace python client

client_stub = pydgraph.DgraphClientStub('localhost:9080')
client = pydgraph.DgraphClient(client_stub)
client.login_into_namespace("groot", "password", "5")
Exception Type:	AttributeError
Exception Value: 'NoneType' object has no attribute 'txn'