Skip to content
This repository was archived by the owner on Mar 27, 2019. It is now read-only.

Commit 3ae1efa

Browse files
authored
use pip via subprocess, not pip.main (#57)
1 parent 7367f8e commit 3ae1efa

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

langserver/fetch.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import shutil
55
import logging
66

7-
import pip
8-
97
from typing import List
108

119
log = logging.getLogger(__name__)
@@ -25,12 +23,12 @@ def fetch_dependency(module_name: str, specifier: str, install_path: str, pip_ar
2523
module_name, download_folder, exc_info=True)
2624
# TODO: check the result status
2725

28-
result = pip.main(
29-
["download", "--no-deps", "-d", download_folder] +
26+
result = subprocess.run(
27+
["pip", "download", "--no-deps", "-d", download_folder] +
3028
pip_args +
3129
[module_name + specifier]
3230
)
33-
if result != 0:
31+
if result.returncode != 0:
3432
log.error("Unable to fetch package %s", module_name)
3533
return
3634
for thing in os.listdir(download_folder):

0 commit comments

Comments
 (0)