Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (24 sloc) 1007 Bytes

title: Multiple Python versions with SublimeText-flake8

date: 2017-03-17 12:50:00+02:00




I couldn't get linting for different Python versions working with SublimeLinter-flake8. It only ever worked with either Python 2.x or Python 3.x.

The following is the way I got it working. If anyone knows a better way, please let me know.

Thanks to the changes in PR #47_ and the following script, I was able to get it to work.

.. code-block:: python

import os
import sys

python = "python%s.%s" % sys.version_info[:2]
os.execvp(python, [python, '-m', 'flake8'] + sys.argv[1:])

The flake8 package needs to be installed in the relevant Python versions.

To debug, follow the troubleshooting guide_ of SublimeLinter3.

.. _PR #47: .. _troubleshooting guide: