mirror of
https://github.com/python/cpython.git
synced 2025-10-31 21:51:50 +00:00
Remove apply()
This commit is contained in:
parent
fe55464f39
commit
d91085598f
56 changed files with 179 additions and 285 deletions
|
|
@ -148,10 +148,10 @@ def f1(lock, f2=f2, done=done):
|
|||
class LockingMethodWrapper(MetaMethodWrapper):
|
||||
def __call__(self, *args, **kw):
|
||||
if self.__name__[:1] == '_' and self.__name__[1:] != '_':
|
||||
return apply(self.func, (self.inst,) + args, kw)
|
||||
return self.func(self.inst, *args, **kw)
|
||||
self.inst.__lock__.acquire()
|
||||
try:
|
||||
return apply(self.func, (self.inst,) + args, kw)
|
||||
return self.func(self.inst, *args, **kw)
|
||||
finally:
|
||||
self.inst.__lock__.release()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue