| @@ -20,6 +20,7 @@ | |||||
| # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||||
| # SOFTWARE. | # SOFTWARE. | ||||
| import imp | |||||
| import logging | import logging | ||||
| from earwigbot.irc import IRCConnection, RC, BrokenSocketException | from earwigbot.irc import IRCConnection, RC, BrokenSocketException | ||||
| @@ -86,8 +87,9 @@ class Watcher(IRCConnection): | |||||
| rules = config.data["rules"] | rules = config.data["rules"] | ||||
| except KeyError: | except KeyError: | ||||
| return | return | ||||
| module = imp.new_module("_rc_event_rules") | |||||
| try: | try: | ||||
| module = compile(rules, config.config_path, "exec") | |||||
| exec compile(rules, config.config_path, "exec") in module.__dict__ | |||||
| except Exception: | except Exception: | ||||
| e = "Could not compile config file's RC event rules" | e = "Could not compile config file's RC event rules" | ||||
| self.logger.exception(e) | self.logger.exception(e) | ||||