[ 
https://issues.apache.org/jira/browse/AMBARI-25910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wei-Chiu Chuang resolved AMBARI-25910.
--------------------------------------
    Resolution: Won't Fix

> 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
>         Environment: {*}Ambari:{*}Ambari-2.7.5
> *OS:*        OpenEuler-22.03
> *Python:* Python 3.9.9
>            Reporter: Charming Wu
>            Priority: Major
>              Labels: hasattr, python2, python3
>         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]

Reply via email to