pcp
[Top] [All Lists]

Re: [pcp] Lots of Python failures on Centos 5.10

To: pcp@xxxxxxxxxxx
Subject: Re: [pcp] Lots of Python failures on Centos 5.10
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Thu, 11 Sep 2014 17:25:37 +1000
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <540CDD93.1040606@xxxxxxxxxxxxxxxx>
References: <540CDD93.1040606@xxxxxxxxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0
I know it is bad form to reply to your own posts, but silence has driven me to this.

On 08/09/14 08:34, Ken McDonell wrote:
Things like

QA output created by 702
live -   File "/home/kenj/src/pcp/qa/src/test_pcp.python", line 77
     except pmapi.pmErr as error:
                         ^
SyntaxError: invalid syntax
...

The problem here is the version of Python ... it is 2.4.3 on CentOS 5.10. For Python 2.5 or earlier, "as" is not allowed and "," must be used.

So I need Python-expert guidance here ... in PCPland should we

(a) disable all the Python bits for Python 2.5 or earlier?
(b) use the old-style "," everywhere (which apparently works in later versions)? or
(c) is there some clever Python trick I'm missing?

This construct is _everywhere_ in the Python code (installed PCP bits and QA bits), so answer carefully.

Although I've committed a patch to the Gluster PMDA earlier today, I've never written any other Python code, so I'm a 100% Python newbie.

<Prev in Thread] Current Thread [Next in Thread>