From f88b0a11e96dfceae8fad1dc39be6f8ec6724a3f Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 14 Aug 2016 16:46:11 +0100 Subject: [PATCH] Python 2.4 fixes. --- econtext/core.py | 6 +++--- econtext/master.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/econtext/core.py b/econtext/core.py index 6d3aae1b..3a7371f7 100644 --- a/econtext/core.py +++ b/econtext/core.py @@ -164,7 +164,7 @@ class Importer(object): try: self._ignore.append(fullname) try: - __import__(fullname, fromlist=['*']) + __import__(fullname, {}, {}, ['*']) except ImportError: LOG.debug('find_module(%r) returning self', fullname) return self @@ -266,7 +266,7 @@ class Stream(BasicStream): def __init__(self, context): self._context = context self._lock = threading.Lock() - self._rhmac = hmac.new(context.key, digestmod=sha.new) + self._rhmac = hmac.new(context.key, digestmod=sha) self._whmac = self._rhmac.copy() _find_global = None @@ -702,7 +702,7 @@ class ExternalContext(object): args = (self,) + args try: - obj = __import__(modname, fromlist=['*']) + obj = __import__(modname, {}, {}, ['*']) if klass: obj = getattr(obj, klass) fn = getattr(obj, func) diff --git a/econtext/master.py b/econtext/master.py index 8f3328fd..77bd1b0e 100644 --- a/econtext/master.py +++ b/econtext/master.py @@ -109,7 +109,7 @@ class ModuleResponder(object): reply_to, fullname = data LOG.debug('get_module(%r, %r)', reply_to, fullname) try: - module = __import__(fullname, fromlist=['']) + module = __import__(fullname, {}, {}, ['']) is_pkg = getattr(module, '__path__', None) is not None path = inspect.getsourcefile(module) try: