changeset 831:d1c147c73f34

bytes vs string
author Jeff Hammel <k0scist@gmail.com>
date Sun, 19 Feb 2017 18:02:32 -0800
parents 6de24d387889
children b9be1237fffa
files python/hgrc.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/python/hgrc.py	Sun Feb 19 17:55:23 2017 -0800
+++ b/python/hgrc.py	Sun Feb 19 18:02:32 2017 -0800
@@ -21,16 +21,18 @@
 import subprocess
 import sys
 from collections import OrderedDict
-from StringIO import StringIO
+
 
 try:
     # python 2
     import urlparse
     from ConfigParser import RawConfigParser as ConfigParser
+    from StringIO import StringIO
 except ImportError:
     # python 3
     import urllib.parse as urlparse
     from configparser import RawConfigParser as ConfigParser
+    from io import StringIO
 
 ### global methods
 
@@ -116,7 +118,7 @@
 
     # if not specified, use repo from `hg root`
     if not args:
-        args = [subprocess.check_output(['hg', 'root']).strip()]
+        args = [subprocess.check_output(['hg', 'root']).strip().decode('utf-8')]
 
     # if not specified, set a default action
     default_action = 'default_push_ssh'