MCPcopy Index your code
hub / github.com/python/cpython / _splitport

Function _splitport

Lib/urllib/parse.py:1315–1326  ·  view source on GitHub ↗

splitport('host:port') --> 'host', 'port'.

(host)

Source from the content-addressed store, hash-verified

1313# splittag('/path#tag') --> '/path', 'tag'
1314_portprog = None
1315def _splitport(host):
1316 """splitport('host:port') --> 'host', 'port'."""
1317 global _portprog
1318 if _portprog is None:
1319 _portprog = re.compile('(.*):([0-9]*)', re.DOTALL)
1320
1321 match = _portprog.fullmatch(host)
1322 if match:
1323 host, port = match.groups()
1324 if port:
1325 return host, port
1326 return host, None
1327
1328
1329def splitnport(host, defport=-1):

Callers 6

reduce_uriMethod · 0.90
ftp_openMethod · 0.90
proxy_bypass_environmentFunction · 0.90
splitportFunction · 0.85

Calls 2

compileMethod · 0.45
groupsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…