Charming Wu created AMBARI-25910:
------------------------------------
Summary: modify Function hasattr from python2 to python3
Key: AMBARI-25910
URL: https://issues.apache.org/jira/browse/AMBARI-25910
Project: Ambari
Issue Type: Sub-task
Components: ambari-client
Affects Versions: 2.7.5
Reporter: Charming Wu
Attachments: image-2023-03-22-12-02-53-173.png
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:
!image-2023-03-22-12-02-53-173.png!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]