comparison mercurial/util.py @ 26587:56b2bcea2529

error: get Abort from 'error' instead of 'util' The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be confused about that and gives all the credit to 'util' instead of the hardworking 'error'. In a spirit of equity, we break the cycle of injustice and give back to 'error' the respect it deserves. And screw that 'util' poser. For great justice.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 08 Oct 2015 12:55:45 -0700
parents 13272104bb07
children 6331a0c310db
comparison
equal deleted inserted replaced
26586:d51c658d3f04 26587:56b2bcea2529
1923 def getport(port): 1923 def getport(port):
1924 """Return the port for a given network service. 1924 """Return the port for a given network service.
1925 1925
1926 If port is an integer, it's returned as is. If it's a string, it's 1926 If port is an integer, it's returned as is. If it's a string, it's
1927 looked up using socket.getservbyname(). If there's no matching 1927 looked up using socket.getservbyname(). If there's no matching
1928 service, util.Abort is raised. 1928 service, error.Abort is raised.
1929 """ 1929 """
1930 try: 1930 try:
1931 return int(port) 1931 return int(port)
1932 except ValueError: 1932 except ValueError:
1933 pass 1933 pass