Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/util.py @ 36076:15c8c4ac5d9c
py3: pass system string to socket.getservbyname
Differential Revision: https://phab.mercurial-scm.org/D2139
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 11 Feb 2018 12:55:50 -0800 |
parents | 72de5c504833 |
children | 02ed94dd9fd6 |
comparison
equal
deleted
inserted
replaced
36075:8de90e006c78 | 36076:15c8c4ac5d9c |
---|---|
2715 return int(port) | 2715 return int(port) |
2716 except ValueError: | 2716 except ValueError: |
2717 pass | 2717 pass |
2718 | 2718 |
2719 try: | 2719 try: |
2720 return socket.getservbyname(port) | 2720 return socket.getservbyname(pycompat.sysstr(port)) |
2721 except socket.error: | 2721 except socket.error: |
2722 raise Abort(_("no port number associated with service '%s'") % port) | 2722 raise Abort(_("no port number associated with service '%s'") % port) |
2723 | 2723 |
2724 _booleans = {'1': True, 'yes': True, 'true': True, 'on': True, 'always': True, | 2724 _booleans = {'1': True, 'yes': True, 'true': True, 'on': True, 'always': True, |
2725 '0': False, 'no': False, 'false': False, 'off': False, | 2725 '0': False, 'no': False, 'false': False, 'off': False, |