Here, you don't need to create a new sphinxclient. Declaring it in the __init__ function should be enough.