Skip to content

Commit

Permalink
Run pip in subprocess to work around Debian crash
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastProject committed Mar 23, 2017
1 parent e1120af commit 7cbdcd9
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions pext/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import getopt
import json
import os
import pip
import signal
import sys
import threading
Expand All @@ -39,7 +38,7 @@

from importlib import reload # type: ignore
from shutil import rmtree
from subprocess import check_call, check_output, CalledProcessError, Popen
from subprocess import check_call, check_output, CalledProcessError, Popen, run
from typing import Dict, List, Optional, Tuple
from urllib.error import URLError
from urllib.request import urlopen
Expand Down Expand Up @@ -472,12 +471,16 @@ def _pip_install(self, module_dir_name: str) -> int:
# Probably already exists, that's okay
pass

return pip.main(['install',
'--upgrade',
'--target',
module_dependencies_path,
'-r',
module_requirements_path])
return run([sys.executable,
'-m',
'pip',
'install',
'--system',
'--upgrade',
'--target',
module_dependencies_path,
'-r',
module_requirements_path]).returncode

def bind_logger(self, logger: Logger) -> str:
"""Connect a logger to the module manager.
Expand Down

0 comments on commit 7cbdcd9

Please sign in to comment.