##// END OF EJS Templates
add a deprecation warning for gc based lock releasing
Ronny Pfannschmidt -
r8113:87a16059 default
parent child Browse files
Show More
@@ -6,6 +6,7 b''
6 # of the GNU General Public License, incorporated herein by reference.
6 # of the GNU General Public License, incorporated herein by reference.
7
7
8 import errno, os, socket, time, util, error
8 import errno, os, socket, time, util, error
9 import warnings
9
10
10 class lock(object):
11 class lock(object):
11 # lock is symlink on platforms that support it, file on others.
12 # lock is symlink on platforms that support it, file on others.
@@ -28,6 +29,10 b' class lock(object):'
28
29
29 def __del__(self):
30 def __del__(self):
30 if self.held:
31 if self.held:
32 warnings.warn("use lock.release instead of del lock",
33 category=DeprecationWarning,
34 stacklevel=2)
35
31 # ensure the lock will be removed
36 # ensure the lock will be removed
32 # even if recursive locking did occur
37 # even if recursive locking did occur
33 self.held = 1
38 self.held = 1
General Comments 0
You need to be logged in to leave comments. Login now