Преглед на файлове

Fixes compatibility with pycallgraph. Closes #1051

Ask Solem преди 12 години
родител
ревизия
8637e30215
променени са 1 файла, в които са добавени 4 реда и са изтрити 3 реда
  1. 4 3
      celery/local.py

+ 4 - 3
celery/local.py

@@ -124,10 +124,11 @@ class Proxy(object):
         object behind the proxy at a time for performance reasons or because
         you want to pass the object into a different context.
         """
-        if not hasattr(self.__local, '__release_local__'):
-            return self.__local(*self.__args, **self.__kwargs)
+        loc = object.__getattribute__(self, '_Proxy__local')
+        if not hasattr(loc, '__release_local__'):
+            return loc(*self.__args, **self.__kwargs)
         try:
-            return getattr(self.__local, self.__name__)
+            return getattr(loc, self.__name__)
         except AttributeError:
             raise RuntimeError('no object bound to %s' % self.__name__)