Skip to content

Conversation

@blueyed
Copy link
Contributor

@blueyed blueyed commented Feb 10, 2020

Fixes collection error with Python 3.5.3 (Travis):

testing/test_parseopt.py:2: in <module>
    import distutils.spawn
.tox/py35-coverage/lib/python3.5/distutils/__init__.py:4: in <module>
    import imp
.tox/py35-coverage/lib/python3.5/imp.py:33: in <module>
    PendingDeprecationWarning, stacklevel=2)
E   PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

Build log: https://travis-ci.org/blueyed/pytest/builds/648305304

@bluetech
Copy link
Member

Maybe better to just use shutil.which for this? https://docs.python.org/3/library/shutil.html#shutil.which

Fixes collection error with Python 3.5.3 (Travis):

    testing/test_parseopt.py:2: in <module>
        import distutils.spawn
    .tox/py35-coverage/lib/python3.5/distutils/__init__.py:4: in <module>
        import imp
    .tox/py35-coverage/lib/python3.5/imp.py:33: in <module>
        PendingDeprecationWarning, stacklevel=2)
    E   PendingDeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

Build log: https://travis-ci.org/blueyed/pytest/builds/648305304
@blueyed blueyed changed the title test_argcomplete: move import of distutils test_argcomplete: remove usage of distutils.spawn Feb 10, 2020
@blueyed blueyed force-pushed the test_argcomplete-lazy-import branch from dac29ae to 1a71bda Compare February 10, 2020 10:04
@blueyed
Copy link
Contributor Author

blueyed commented Feb 10, 2020

Maybe better to just use shutil.which for this? https://docs.python.org/3/library/shutil.html#shutil.which

Sure, done.

@blueyed blueyed merged commit 4492904 into pytest-dev:master Feb 10, 2020
@blueyed blueyed deleted the test_argcomplete-lazy-import branch February 10, 2020 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants