Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid stacktrace on process exit in Client.__del__()
Client.close() may call ConnectionPool.release() or ConnectionPool.disconnect(); both methods may end up calling os.getpid() (through ConnectionPool._checkpid() or threading.Lock() (through ConnectionPool.reset()). As mentioned in the Python documentation [1], at interpreter shutdown, module globals (in this case, the os and threading module references) may be deleted or set to None before __del__() methods are called. This causes an AttributeError to be raised when trying to run e.g. os.getpid(); while the error is ignored by the interpreter, the traceback is still printed out to stderr. Closes redis#3014 [1] https://docs.python.org/3/reference/datamodel.html#object.__del__
- Loading branch information