Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG15c8c4ac5d9c: py3: pass system string to socket.getservbyname
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/util.py (2 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Needs Revision | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg |
service, error.Abort is raised. | service, error.Abort is raised. | ||||
""" | """ | ||||
try: | try: | ||||
return int(port) | return int(port) | ||||
except ValueError: | except ValueError: | ||||
pass | pass | ||||
try: | try: | ||||
return socket.getservbyname(port) | return socket.getservbyname(pycompat.sysstr(port)) | ||||
except socket.error: | except socket.error: | ||||
raise Abort(_("no port number associated with service '%s'") % port) | raise Abort(_("no port number associated with service '%s'") % port) | ||||
_booleans = {'1': True, 'yes': True, 'true': True, 'on': True, 'always': True, | _booleans = {'1': True, 'yes': True, 'true': True, 'on': True, 'always': True, | ||||
'0': False, 'no': False, 'false': False, 'off': False, | '0': False, 'no': False, 'false': False, 'off': False, | ||||
'never': False} | 'never': False} | ||||
def parsebool(s): | def parsebool(s): |