Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend special handling of sys.executable to pythonX[.Y] #306

Merged
merged 1 commit into from
Dec 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions jupyter_client/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
import signal
import sys
import time
import warnings
try:
from queue import Empty # Py 3
except ImportError:
from Queue import Empty # Py 2

import zmq

Expand All @@ -29,7 +24,6 @@
kernelspec,
)
from .connect import ConnectionFileMixin
from .session import Session
from .managerabc import (
KernelManagerABC
)
Expand Down Expand Up @@ -164,8 +158,10 @@ def format_kernel_cmd(self, extra_arguments=None):
else:
cmd = self.kernel_spec.argv + extra_arguments

if cmd and cmd[0] == 'python':
# executable is 'python', use sys.executable.
if cmd and cmd[0] in {'python',
'python%i' % sys.version_info[0],
'python%i.%i' % sys.version_info[:2]}:
# executable is 'python' or 'python3', use sys.executable.
# These will typically be the same,
# but if the current process is in an env
# and has been launched by abspath without
Expand Down