diff mercurial/encoding.py @ 31777:7d2cbe11ae48

pycompat: introduce identity function as a compat stub I was sometimes too lazy to use 'str' instead of 'lambda a: a'. Let's add a named function for that purpose.
author Yuya Nishihara <yuya@tcha.org>
date Wed, 29 Mar 2017 21:13:55 +0900
parents 6419cd243017
children 6c0ae9683437
line wrap: on
line diff
--- a/mercurial/encoding.py	Sun Apr 02 02:29:51 2017 -0400
+++ b/mercurial/encoding.py	Wed Mar 29 21:13:55 2017 +0900
@@ -211,8 +211,8 @@
     strtolocal = unitolocal
     strfromlocal = unifromlocal
 else:
-    strtolocal = str
-    strfromlocal = str
+    strtolocal = pycompat.identity
+    strfromlocal = pycompat.identity
 
 if not _nativeenviron:
     # now encoding and helper functions are available, recreate the environ