diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index 6e561dd36..0d758325d 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -46,6 +46,12 @@ called.") (when (featurep! +lsp) (add-hook 'python-mode-local-vars-hook #'lsp!)) + ;; Default to Python 3. Prefer the versioned Python binaries since some + ;; systems stupidly make the unversioned one point at Python 2. + (when (and (executable-find "python3") + (string= python-shell-interpreter "python")) + (setq python-shell-interpreter "python3")) + (add-hook 'python-mode-hook (defun +python-use-correct-flycheck-executables-h () "Use the correct Python executables for Flycheck."