MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _splitport

Function _splitport

tools/python-3.11.9-amd64/Lib/urllib/parse.py:1135–1146  ·  view source on GitHub ↗

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

(host)

Source from the content-addressed store, hash-verified

1133# splittag('/path#tag') --> '/path', 'tag'
1134_portprog = None
1135def _splitport(host):
1136 """splitport('host:port') --> 'host', 'port'."""
1137 global _portprog
1138 if _portprog is None:
1139 _portprog = re.compile('(.*):([0-9]*)', re.DOTALL)
1140
1141 match = _portprog.fullmatch(host)
1142 if match:
1143 host, port = match.groups()
1144 if port:
1145 return host, port
1146 return host, None
1147
1148
1149def splitnport(host, defport=-1):

Callers 9

reduce_uriMethod · 0.90
open_local_fileMethod · 0.90
ftp_openMethod · 0.90
open_local_fileMethod · 0.90
open_ftpMethod · 0.90
proxy_bypass_environmentFunction · 0.90
splitportFunction · 0.85

Calls 2

compileMethod · 0.45
groupsMethod · 0.45

Tested by

no test coverage detected