Show More
@@ -13,7 +13,6 b' import shlex' | |||
|
13 | 13 | import sys |
|
14 | 14 | from pathlib import Path |
|
15 | 15 | |
|
16 | from pathlib import Path | |
|
17 | 16 | from IPython.core.magic import Magics, magics_class, line_magic |
|
18 | 17 | |
|
19 | 18 | |
@@ -28,7 +27,7 b' def _get_conda_executable():' | |||
|
28 | 27 | # Check if there is a conda executable in the same directory as the Python executable. |
|
29 | 28 | # This is the case within conda's root environment. |
|
30 | 29 | conda = Path(sys.executable).parent / "conda" |
|
31 | if conda.isfile(): | |
|
30 | if conda.is_file(): | |
|
32 | 31 | return str(conda) |
|
33 | 32 | |
|
34 | 33 | # Otherwise, attempt to extract the executable from conda history. |
@@ -83,8 +82,9 b' class PackagingMagics(Magics):' | |||
|
83 | 82 | |
|
84 | 83 | conda = _get_conda_executable() |
|
85 | 84 | args = shlex.split(line) |
|
86 | command = args[0] | |
|
87 | args = args[1:] | |
|
85 | command = args[0] if len(args) > 0 else "" | |
|
86 | args = args[1:] if len(args) > 1 else [""] | |
|
87 | ||
|
88 | 88 | extra_args = [] |
|
89 | 89 | |
|
90 | 90 | # When the subprocess does not allow us to respond "yes" during the installation, |
General Comments 0
You need to be logged in to leave comments.
Login now