You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Charming Wu (Jira)" <ji...@apache.org> on 2023/03/22 04:03:00 UTC

[jira] [Created] (AMBARI-25910) modify Function hasattr from python2 to python3

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: issues-unsubscribe@ambari.apache.org
For additional commands, e-mail: issues-help@ambari.apache.org