ganglia / monitor-core

Ganglia Monitoring core
BSD 3-Clause "New" or "Revised" License
490 stars 246 forks source link

fix python syntax in configure.ac #324

Closed meow-watermelon closed 2 years ago

meow-watermelon commented 2 years ago

Signed-off-by: Hui Li herdingcat@yahoo.com

meow-watermelon commented 2 years ago

The original print syntax is only working on Python 2. It does not work under Python 3.

meow-watermelon commented 2 years ago

I imported print_function which is for Py2 compatibility. Could you please have a look? Thanks.

carenas commented 2 years ago

guess that might work, but isn't there a way to make the check use python 3 syntax only if your python is 3.x?

and out of curiosity, does this mean you actually have this building against python3 and have python modules written in python3 as well?

are those modules also able to work when gmond is built with an older python?

meow-watermelon commented 2 years ago

Sorry I'm not sure I understand your question well. I think my PR just make this configure.ac file work under Py2 and Py3 both. And import future is a way to make print function work under both Py2 and Py3.

And yes, my computer only has Py3 installed so all my buildings are against Py3 but I'm not sure if those modules can be working under older Py.

carenas commented 2 years ago

Sorry I'm not sure I understand your question well. I think my PR just make this configure.ac file work under Py2 and Py3 both. And import future is a way to make print function work under both Py2 and Py3.

but drops support for versions of python2 that don't have future (~2.1) or that have it and don't have print_function (~2.6).

if your change would be done after checking that your version of python is 3, then there is no backward compatibility issue or need to drop support for anyone.

And yes, my computer only has Py3 installed so all my buildings are against Py3 but I'm not sure if those modules can be working under older Py.

not sure if you realize it, but the python modules are not using the python interpreter on your machine, but the one linked with ganglia.

by doing this change, you are not only allowing ganglia to recognize python3, but also the possibility that someone might then use python3 specific syntax in their modules and make them incompatible with people that built their ganglia against a version that doesn't support that syntax, so the change is a little more involved than it seems.

what is the use case you are aiming for?, do you need python3 or is it just that is all you have locally and don't want to install 2.7 anymore, even if your modules will be clean python 2 code?

meow-watermelon commented 2 years ago

I see. My initial intention for this PR is just to make it work under my computer but this involves too many compatibility concerns then I will close this PR.