##// END OF EJS Templates
lock: do not encode result of gethostname on Python 2...
Yuya Nishihara -
r31378:2e48c776 default
parent child Browse files
Show More
@@ -28,8 +28,9 b' def _getlockprefix():'
28 confidence. Typically it's just hostname. On modern linux, we include an
28 confidence. Typically it's just hostname. On modern linux, we include an
29 extra Linux-specific pid namespace identifier.
29 extra Linux-specific pid namespace identifier.
30 """
30 """
31 result = socket.gethostname().encode(
31 result = socket.gethostname()
32 pycompat.sysstr(encoding.encoding), 'replace')
32 if pycompat.ispy3:
33 result = result.encode(pycompat.sysstr(encoding.encoding), 'replace')
33 if pycompat.sysplatform.startswith('linux'):
34 if pycompat.sysplatform.startswith('linux'):
34 try:
35 try:
35 result += '/%x' % os.stat('/proc/self/ns/pid').st_ino
36 result += '/%x' % os.stat('/proc/self/ns/pid').st_ino
General Comments 0
You need to be logged in to leave comments. Login now