##// END OF EJS Templates
py3: replace "if ispy3" by encoding.strtolocal()
Yuya Nishihara -
r35915:4b1c0408 default
parent child Browse files
Show More
@@ -30,9 +30,7 b' def _getlockprefix():'
30 confidence. Typically it's just hostname. On modern linux, we include an
30 confidence. Typically it's just hostname. On modern linux, we include an
31 extra Linux-specific pid namespace identifier.
31 extra Linux-specific pid namespace identifier.
32 """
32 """
33 result = socket.gethostname()
33 result = encoding.strtolocal(socket.gethostname())
34 if pycompat.ispy3:
35 result = result.encode(pycompat.sysstr(encoding.encoding), 'replace')
36 if pycompat.sysplatform.startswith('linux'):
34 if pycompat.sysplatform.startswith('linux'):
37 try:
35 try:
38 result += '/%x' % os.stat('/proc/self/ns/pid').st_ino
36 result += '/%x' % os.stat('/proc/self/ns/pid').st_ino
@@ -1508,11 +1508,7 b' class ui(object):'
1508 ''.join(exconly))
1508 ''.join(exconly))
1509 else:
1509 else:
1510 output = traceback.format_exception(exc[0], exc[1], exc[2])
1510 output = traceback.format_exception(exc[0], exc[1], exc[2])
1511 data = r''.join(output)
1511 self.write_err(encoding.strtolocal(r''.join(output)))
1512 if pycompat.ispy3:
1513 enc = pycompat.sysstr(encoding.encoding)
1514 data = data.encode(enc, errors=r'replace')
1515 self.write_err(data)
1516 return self.tracebackflag or force
1512 return self.tracebackflag or force
1517
1513
1518 def geteditor(self):
1514 def geteditor(self):
General Comments 0
You need to be logged in to leave comments. Login now