Christian Heimes wrote:
Thankfully this issue was fixed in Python 2.6 and 3.0. In newer versions of Python hasattr() only swallows exception based on the Exception class but not BaseExceptions.
Shouldn't it only be catching AttributeError, though?
We should make sure all code in the core behaves the same way. Exceptions based on BaseException must *never* be swallowed.
Seems to me that all code in the core that catches exceptions should only be catching the exceptions it really needs to catch. That requires looking at each case individually rather than a blanket "catch Exception" recommendation (although that might still be an improvement over the status quo). -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com