On 01.11.2019 09:58, Yasuhito FUTATSUKI wrote:
> On 2019/11/01 14:23, Nathan Hartman wrote:
>> On Fri, Oct 18, 2019 at 9:22 AM Branko Čibej <brane_at_apache.org> wrote:
>>
>>> Running the build scripts and tests with Python3 works now on trunk,
>>> with the latest fixes. Except for this warning:
>>>
>>> .../run_tests.py:53: DeprecationWarning: the imp module is
>>> deprecated in
>>> favour of importlib; see the module's documentation for alternative
>>> uses
>>> import optparse, subprocess, imp, threading, traceback
>>>
>>>
>>> I know we make 'imp' vs. 'importlib' choices elsewhere in the code, we
>>> probably just missed a case here.
>>>
>>
>> Where?
>>
>> I searched but did not find any other 'imp' vs 'importlib' choices in
>> any of the *.py files, neither on trunk nor on the branch swig-py3,
>> except for the instance you note above in run_tests.py.
>
> I saw them in build tree, however they were not our code but the code
> generated by SWIG (< 4.0) for swig Python bindings.
>
>> 'imp' is only used in TestHarness._run_py_test to call
>> imp.load_module. In that function, there is one version of the call
>> for Py < 3.0, another for Py >= 3.0.
>>
>> But imp was deprecated in Py 3.4, not 3.0, and imp.PY_SOURCE was
>> deprecated in 3.3, so there are too many different versions at play
>> here.
>>
>> Suggestions?
>
> In this case, if you can rewrite it with importlib.import_module()
> for Python 2.7 and Python 3.1, perhaps it will also work with
> Python 3.2 and later.
>
>
> However, it seems there is more general question, "What versions
> do we support on Python 3?"
>
> It seems we don't promise to support any version of Python 3 yet.
> So I think we can restrict version to support for Python 3,
> comparatively safely.
>
> Python 3.4 had reached end of life[1]. And developers might not
> have test environment with older Python 3.
To be honest, I wouldn't care about any Python 3 older than 3.5. IMO it
took the 3.x series quite a while to mature from "wow, a new major
version!" to "a better scripting language". 3.5 or thereabouts was the
turning point.
-- Brane
Received on 2019-11-01 11:23:45 CET