MCPcopy Index your code
hub / github.com/RustPython/RustPython / _splitport

Function _splitport

Lib/urllib/parse.py:1195–1206  ·  view source on GitHub ↗

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

(host)

Source from the content-addressed store, hash-verified

1193# splittag('/path#tag') --> '/path', 'tag'
1194_portprog = None
1195def _splitport(host):
1196 """splitport('host:port') --> 'host', 'port'."""
1197 global _portprog
1198 if _portprog is None:
1199 _portprog = re.compile('(.*):([0-9]*)', re.DOTALL)
1200
1201 match = _portprog.fullmatch(host)
1202 if match:
1203 host, port = match.groups()
1204 if port:
1205 return host, port
1206 return host, None
1207
1208
1209def splitnport(host, defport=-1):

Callers 6

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

Calls 3

fullmatchMethod · 0.80
compileMethod · 0.45
groupsMethod · 0.45

Tested by

no test coverage detected