Fix FutureWarning related to nested sets.

See https://bugs.python.org/issue30349
This commit is contained in:
Valentin Lorentz 2018-12-29 23:36:57 +01:00
parent 2c7c83b07d
commit fcf30a5601
4 changed files with 4 additions and 4 deletions

View File

@ -292,7 +292,7 @@ class ChannelStats(callbacks.Plugin):
name, channel))
stats = wrap(stats, ['channeldb', additional('something')])
_calc_match_forbidden_chars = re.compile('[_[\]]')
_calc_match_forbidden_chars = re.compile('[_\[\]]')
_env = {'__builtins__': types.ModuleType('__builtins__')}
_env.update(math.__dict__)
def _factorial(x):

View File

@ -157,7 +157,7 @@ class Math(callbacks.Plugin):
else:
return '%s%s' % (realS, imagS)
_calc_match_forbidden_chars = re.compile('[_[\]]')
_calc_match_forbidden_chars = re.compile('[_\[\]]')
_calc_remover = utils.str.MultipleRemover('_[] \t')
###
# So this is how the 'calc' command works:

View File

@ -151,7 +151,7 @@ class Nickometer(callbacks.Plugin):
nickInitial = nick
nick=re.sub('^([^()]*)(\()(.*)(\))([^()]*)$', '\1\3\5', nick, 1)
nick=re.sub('^([^{}]*)(\{)(.*)(\})([^{}]*)$', '\1\3\5', nick, 1)
nick=re.sub('^([^[\]]*)(\[)(.*)(\])([^[\]]*)$', '\1\3\5', nick, 1)
nick=re.sub('^([^\[\]]*)(\[)(.*)(\])([^\[\]]*)$', '\1\3\5', nick, 1)
if nick == nickInitial:
break
self.log.debug('Removed some matching brackets %r => %r',

View File

@ -181,7 +181,7 @@ def _hostmaskPatternEqual(pattern, hostmask):
elif c == '?':
fd.write('.')
elif c in '[{':
fd.write('[[{]')
fd.write(r'[\[{]')
elif c in '}]':
fd.write(r'[}\]]')
elif c in '|\\':