Please use twitter.common.lang Compatibility.exec_function:

https://github.com/twitter/commons/blob/master/src/python/twitter/common/lang/__init__.py#L122

Happy on 2.x and 3.x (even 2.6.x)


On Tue, Apr 29, 2014 at 6:31 AM, Mark Chu-Carroll <mchucarr...@apache.org>wrote:

> Folks:
>
> For one of the client changes I'm working on, there's a python version
> compatibility issue.
>
> For Python 2.7 and 3.x, there's an "exec" function which I use for loading
> hooks. In python 2.6, exec is a statement, an the function form doesn't
> work.
>
> This is something that can be worked around, but the workaround is ugly -
> you need to introspect to see the python version, and then choose an
> implementation based on the version.
>
> My inclination is to say that supporting 2.7 and 3.x is sufficient, and we
> shouldn't be adding new workarounds for 2.6. But I don't want to make that
> decision myself for everyone.
>
> Do we care about continuing to support Python 2.6 for the Aurora client?
>
>      -Mark
>

Reply via email to