datastax/python-driver — pull request #49 by joaquincasares (2013-10-18 09:17:31+00:00)
Title: Silence exceptions when cluster is shutting down.

I'm not sure if this is the best patch, but I did notice that close() was called elsewhere so I figured just to check for variable existence. Worst case: it showcases where the exceptions on cluster.shutdown() were coming from.

Here are the exceptions that I was getting on a normal program exit:

Exception AttributeError: AttributeError("'NoneType' object has no attribute 'debug'",) in > ignored
Exception AttributeError: "'NoneType' object has no attribute 'debug'" in > ignored

I realized that log was None, much like:
https://github.com/datastax/python-driver/blob/master/cassandra/cluster.py#L1526

As were \_loop\_lock and ConnectionShutdown.