Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.7.5
-
None
-
Ambari:Ambari-2.7.5
OS: OpenEuler-22.03
Python: Python 3.9.9
Description
In python2, hasattr() function catched all attributes lookup exceptions and return False.
But in python3, it only catch AttributeError and return False, when it comes to other exceptions, the call stack will be bubbled up.
In order to adapt from python2 to python3, I would like to add a try-catch block and catch all exceptions and return False: