summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp/plugins')
-rw-r--r--sleekxmpp/plugins/base.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sleekxmpp/plugins/base.py b/sleekxmpp/plugins/base.py
index fabee50d..9a7e1b19 100644
--- a/sleekxmpp/plugins/base.py
+++ b/sleekxmpp/plugins/base.py
@@ -18,6 +18,10 @@ import logging
import threading
+if sys.version_info >= (3, 0):
+ unicode = str
+
+
log = logging.getLogger(__name__)
@@ -84,9 +88,11 @@ def load_plugin(name, module=None):
module = 'sleekxmpp.features.%s' % name
__import__(module)
mod = sys.modules[module]
- else:
+ elif isinstance(module, (str, unicode)):
__import__(module)
mod = sys.modules[module]
+ else:
+ mod = module
# Add older style plugins to the registry.
if hasattr(mod, name):