Skip to content

Commit 4ba1984

Browse files
author
bspkrs
committed
maybe finally fixed ipv6???
1 parent ea38674 commit 4ba1984

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

IRCHandler.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,15 @@ def conv_ip_long_std(cls, longip):
155155

156156
@classmethod
157157
def conv_ip_std_long(cls, stdip):
158+
if stdip.find(':') != -1:
159+
return stdip
160+
158161
address = stdip.split('.')
159-
if len(address) != 4 and stdip.find(':') != -1:
162+
if len(address) != 4:
160163
return 0
161164
longip = 0
162165
for part, shift in zip(address, [24, 16, 8, 0]):
163-
try:
164-
ip_part = int(part)
165-
except ValueError:
166-
return stdip
166+
ip_part = int(part)
167167
if ip_part >= 2 ** 8:
168168
return stdip
169169
longip += ip_part << shift

MCPBot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import zipfile, os
1111
import psycopg2.extras
1212

13-
__version__ = "0.6.0"
13+
__version__ = "0.7.0"
1414

1515
class MCPBot(BotBase):
1616
def __init__(self, nspass=None, backupcfg=False):

0 commit comments

Comments
 (0)