py3: pass system string to socket.getservbyname
authorGregory Szorc <gregory.szorc@gmail.com>
Sun, 11 Feb 2018 12:55:50 -0800
changeset 36038 15c8c4ac5d9c
parent 36037 8de90e006c78
child 36039 c1e01b1d5543
py3: pass system string to socket.getservbyname Differential Revision: https://phab.mercurial-scm.org/D2139
mercurial/util.py
--- a/mercurial/util.py	Sun Feb 11 12:42:10 2018 -0800
+++ b/mercurial/util.py	Sun Feb 11 12:55:50 2018 -0800
@@ -2717,7 +2717,7 @@
         pass
 
     try:
-        return socket.getservbyname(port)
+        return socket.getservbyname(pycompat.sysstr(port))
     except socket.error:
         raise Abort(_("no port number associated with service '%s'") % port)