# HG changeset patch # User Jeff Hammel # Date 1487556152 28800 # Node ID d1c147c73f34e61ba1fa36074ec2cbf9a44b630c # Parent 6de24d38788969d01927aa37aa5bcc183bf87fb8 bytes vs string diff -r 6de24d387889 -r d1c147c73f34 python/hgrc.py --- 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'