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:04:00 UTC
[jira] [Updated] (AMBARI-25910) modify Function hasattr from python2 to python3
[ https://issues.apache.org/jira/browse/AMBARI-25910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Charming Wu updated AMBARI-25910:
---------------------------------
Environment:
{*}Ambari:{*}Ambari-2.7.5
*OS:* OpenEuler-22.03
*Python:* Python 3.9.9
> 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: issues-unsubscribe@ambari.apache.org
For additional commands, e-mail: issues-help@ambari.apache.org