##// 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
6 6 # of the GNU General Public License, incorporated herein by reference.
7 7
8 8 import errno, os, socket, time, util, error
9 import warnings
9 10
10 11 class lock(object):
11 12 # lock is symlink on platforms that support it, file on others.
@@ -28,6 +29,10 class lock(object):
28 29
29 30 def __del__(self):
30 31 if self.held:
32 warnings.warn("use lock.release instead of del lock",
33 category=DeprecationWarning,
34 stacklevel=2)
35
31 36 # ensure the lock will be removed
32 37 # even if recursive locking did occur
33 38 self.held = 1
General Comments 0
You need to be logged in to leave comments. Login now