mirror of
https://github.com/Dinnerbone/mcstatus.git
synced 2026-04-06 12:01:24 +08:00
add full bracket support
This commit is contained in:
@@ -38,6 +38,8 @@ def parse_address(address):
|
|||||||
parts[0] = parts[0][1:]
|
parts[0] = parts[0][1:]
|
||||||
parts[-2] = parts[-2][:-1]
|
parts[-2] = parts[-2][:-1]
|
||||||
tmp = ':'.join(parts[0:-1])
|
tmp = ':'.join(parts[0:-1])
|
||||||
|
else:
|
||||||
|
tmp = tmp.replace("[", "").replace("]", "")
|
||||||
|
|
||||||
if not ip_type(tmp) == 6:
|
if not ip_type(tmp) == 6:
|
||||||
raise ValueError("Invalid address '%s'" % address)
|
raise ValueError("Invalid address '%s'" % address)
|
||||||
|
|||||||
Reference in New Issue
Block a user