Commits

Andriy Kornatskyy  committed 8a325a9

Added unicode string compatibility function.

  • Participants
  • Parent commits 2c810ce

Comments (0)

Files changed (1)

File src/wheezy/security/crypto/comp.py

     def btos(b, encoding):
         return b.decode(encoding)
 
+    u = lambda s: s
+
 else:  # pragma: nocover
     bytes_type = str
     str_type = unicode
     def btos(b, encoding):
         return b.decode(encoding)
 
+    u = lambda s: unicode(s, 'unicode_escape')
+
 
 def b(s, encoding='latin1'):  # pragma: nocover
     if isinstance(s, bytes_type):