X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/0ef0d38b8816b9092235ac0f9a7359fc2b6b1365..3cec5bdc665d310ac628e80b007dd2d71ae7d7bd:/erebus.py diff --git a/erebus.py b/erebus.py index a93e1e0..fb6fcc8 100644 --- a/erebus.py +++ b/erebus.py @@ -7,7 +7,7 @@ from __future__ import print_function import os, sys, select, time, traceback, random, gc -import bot, config, ctlmod +import bot, config, ctlmod, modlib class Erebus(object): #singleton to pass around APIVERSION = 0 @@ -241,6 +241,8 @@ class Erebus(object): #singleton to pass around self.bots[nick.lower()] = obj def newfd(self, obj, fileno): + if not isinstance(obj, modlib.Socketlike): + raise Exception('Attempted to hook a socket without a class to process data') self.fds[fileno] = obj if self.potype == "poll": self.po.register(fileno, select.POLLIN)