Mon, 25 Jul 2011 14:59:31 -0500 check-code: disallow use of hasattr()
Augie Fackler <durin42@gmail.com> [Mon, 25 Jul 2011 14:59:31 -0500] rev 14978
check-code: disallow use of hasattr() The hasattr() builtin from Python < 3.2 [1] has slightly surprising behavior: it catches all exceptions, even KeyboardInterrupt. This causes it to have several surprising side effects, such as hiding warnings that occur during attribute load and causing mysterious failure modes when ^Cing an application. In later versions of Python 2.x [0], exception classes which do not inherit from Exception (such as SystemExit and KeyboardInterrupt) are not caught, but other types of exceptions may still silently cause returning False instead of getting a reasonable exception. [0] http://bugs.python.org/issue2196 [1] http://docs.python.org/dev/whatsnew/3.2.html
Mon, 25 Jul 2011 21:15:48 -0500 demandimport: use getattr instead of hasattr
Augie Fackler <durin42@gmail.com> [Mon, 25 Jul 2011 21:15:48 -0500] rev 14977
demandimport: use getattr instead of hasattr We don't use util.safehasattr() here to avoid adding new dependencies for demandimport. This change may expose previously-silenced deprecation warnings to appear, as hasattr silently hides warnings that occur during module import when using demandimport.
(0) -10000 -3000 -1000 -300 -100 -30 -10 -2 +2 +10 +30 +100 +300 +1000 +3000 +10000 +30000 tip