File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -129,12 +129,12 @@ async def _pinger(self):
129129
130130 async def _connect (self ):
131131 while True :
132- try :
133- username = self ._nickname
134- # An additional constraints usernames have over nicknames, that they are
135- # also not allowed to start with an underscore.
136- username = re .sub (r"^_+" , "" , username )
132+ username = self ._nickname
133+ # An additional constraints usernames have over nicknames, that they are
134+ # also not allowed to start with an underscore.
135+ username = re .sub (r"^_+" , "" , username )
137136
137+ try :
138138 await self .connection .connect (
139139 self ._host ,
140140 self ._port ,
Original file line number Diff line number Diff line change 11import asyncio
22import irc .client_aio
33import logging
4+ import re
45import socket
56
67
@@ -139,11 +140,17 @@ async def connect(self):
139140 local_addr = (str (self ._ipv6_address ), 0 )
140141
141142 while self ._reconnect :
143+ username = self ._nickname
144+ # An additional constraints usernames have over nicknames, that they are
145+ # also not allowed to start with an underscore.
146+ username = re .sub (r"^_+" , "" , username )
147+
142148 try :
143149 await self .connection .connect (
144150 self ._irc_host ,
145151 self ._irc_port ,
146152 self ._nickname ,
153+ username = username ,
147154 # We force an IPv6 connection, as we need that for the puppet source address.
148155 connect_factory = irc .connection .AioFactory (
149156 family = socket .AF_INET6 , local_addr = local_addr , ssl = self ._irc_port == 6697
You can’t perform that action at this time.
0 commit comments