Patchwork [1,of,3,hglib] client: extract stub to read server's stderr on close()

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 9, 2015, 3:35 p.m.
Message ID <37004f608c73fccf1750.1441812915@mimosa>
Download mbox | patch
Permalink /patch/10438/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 9, 2015, 3:35 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1441632419 -32400
#      Mon Sep 07 22:26:59 2015 +0900
# Node ID 37004f608c73fccf1750d42037b37fea3082aa67
# Parent  bfdc96f223210867f0f6752700e16eddf2c9224a
client: extract stub to read server's stderr on close()

New _close() function will return (returncode, stderr) pair so that detailed
error message can be obtained.

Patch

diff --git a/hglib/client.py b/hglib/client.py
--- a/hglib/client.py
+++ b/hglib/client.py
@@ -200,6 +200,9 @@  class hgclient(object):
         Attempting to call any function afterwards that needs to
         communicate with the server will raise a ValueError.
         """
+        return self._close()
+
+    def _close(self):
         self.server.stdin.close()
         self.server.wait()
         ret = self.server.returncode