summaryrefslogtreecommitdiffstats
path: root/third_party/typ/typ/host.py
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/typ/typ/host.py')
-rw-r--r--third_party/typ/typ/host.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/third_party/typ/typ/host.py b/third_party/typ/typ/host.py
index c5f6ac8..fc9e113 100644
--- a/third_party/typ/typ/host.py
+++ b/third_party/typ/typ/host.py
@@ -35,6 +35,7 @@ class Host(object):
python_interpreter = sys.executable
is_python3 = bool(sys.version_info.major == 3)
+ pathsep = os.pathsep
sep = os.sep
env = os.environ
@@ -77,6 +78,11 @@ class Host(object):
return proc.returncode, stdout.decode('utf-8'), stderr.decode('utf-8')
def call_inline(self, argv, env=None):
+ if isinstance(self.stdout, _TeedStream): # pragma: no cover
+ ret, out, err = self.call(argv, env)
+ self.print_(out, end='')
+ self.print_(err, end='', stream=self.stderr)
+ return ret
return subprocess.call(argv, stdin=self.stdin, stdout=self.stdout,
stderr=self.stderr, env=env)
@@ -126,6 +132,9 @@ class Host(object):
if not self.exists(path):
os.makedirs(path)
+ def mktempfile(self, delete=True):
+ return tempfile.NamedTemporaryFile(delete=delete)
+
def mkdtemp(self, **kwargs):
return tempfile.mkdtemp(**kwargs)