diff --git a/plugins/Debian.py b/plugins/Debian.py index 8042a33b5..0900ad208 100644 --- a/plugins/Debian.py +++ b/plugins/Debian.py @@ -35,12 +35,12 @@ Add the module docstring here. This will be used by the setup.py script. from baseplugin import * +import re import gzip import popen2 import random import os.path import urllib2 -import re, sre_constants from itertools import imap, ifilter import conf @@ -103,7 +103,7 @@ class Debian(callbacks.Privmsg, PeriodicFileDownloader): regexp = '^' + regexp try: r = re.compile(regexp, re.I) - except sre_constants.error, e: + except re.error, e: irc.error(msg, e) return if self.usePythonZegrep: diff --git a/plugins/Topic.py b/plugins/Topic.py index c0de92ca7..ac50a7195 100644 --- a/plugins/Topic.py +++ b/plugins/Topic.py @@ -42,7 +42,6 @@ from baseplugin import * import re import random -import sre_constants import debug import utils @@ -140,7 +139,7 @@ class Topic(callbacks.Privmsg): replacer = utils.perlReToReplacer(regexp) except ValueError, e: irc.error(msg, 'The regexp wasn\'t valid: %s' % e.args[0]) - except sre_constants.error, e: + except re.error, e: irc.error(msg, debug.exnToString(e)) return topics = irc.state.getTopic(channel).split(self.topicSeparator) diff --git a/src/callbacks.py b/src/callbacks.py index 69afff244..10eb2ab4f 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -48,7 +48,6 @@ import shlex import getopt import inspect import threading -import sre_constants from cStringIO import StringIO import conf @@ -337,6 +336,7 @@ class IrcObjectProxy: return self.irc.getRealIrc() def __getattr__(self, attr): + #return getattr(self.getRealIrc(), attr) return getattr(self.irc, attr) @@ -539,7 +539,7 @@ class PrivmsgRegexp(Privmsg): try: r = re.compile(value.__doc__, self.flags) self.res.append((r, value)) - except sre_constants.error, e: + except re.error, e: s = '%s.%s has an invalid regexp %s: %s' % \ (self.__class__.__name__, name, value.__doc__, debug.exnToString(e))