comparison tests/test-lock.py @ 34909:a52e5604d864 stable

merge default into stable for code freeze # no-check-commit because default contains new vendored code
author Kevin Bullock <kbullock+mercurial@ringworld.org>
date Thu, 19 Oct 2017 15:15:05 -0500
parents daf12f69699f
children 5ee3146c1b20
comparison
equal deleted inserted replaced
34481:bb14dbab4df6 34909:a52e5604d864
17 testlockname = 'testlock' 17 testlockname = 'testlock'
18 18
19 # work around http://bugs.python.org/issue1515 19 # work around http://bugs.python.org/issue1515
20 if types.MethodType not in copy._deepcopy_dispatch: 20 if types.MethodType not in copy._deepcopy_dispatch:
21 def _deepcopy_method(x, memo): 21 def _deepcopy_method(x, memo):
22 return type(x)(x.im_func, copy.deepcopy(x.im_self, memo), x.im_class) 22 return type(x)(x.__func__, copy.deepcopy(x.__self__, memo), x.im_class)
23 copy._deepcopy_dispatch[types.MethodType] = _deepcopy_method 23 copy._deepcopy_dispatch[types.MethodType] = _deepcopy_method
24 24
25 class lockwrapper(lock.lock): 25 class lockwrapper(lock.lock):
26 def __init__(self, pidoffset, *args, **kwargs): 26 def __init__(self, pidoffset, *args, **kwargs):
27 # lock.lock.__init__() calls lock(), so the pidoffset assignment needs 27 # lock.lock.__init__() calls lock(), so the pidoffset assignment needs