Skip to content

Commit

Permalink
Merge pull request #306 from minrk/pythonX
Browse files Browse the repository at this point in the history
extend special handling of sys.executable to pythonX[.Y]
  • Loading branch information
takluyver authored Dec 13, 2017
2 parents 7bbb56d + 948d653 commit 16d8122
Showing 1 changed file with 4 additions and 8 deletions.
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

0 comments on commit 16d8122

Please sign in to comment.