Commits

Andriy Kornatskyy committed c328e22

Added 'ntos' function to convert native to unicode strings.

  • Participants
  • Parent commits b9da70d

Comments (0)

Files changed (1)

File src/wheezy/validation/comp.py

 PY3 = sys.version_info[0] >= 3
 
 if PY3:  # pragma: nocover
+    ntos = lambda s: s
     iterkeys = lambda d: d.keys()
     iteritems = lambda d: d.items()
     copyitems = lambda d: list(d.items())
     regex_pattern = (str,)
 else:  # pragma: nocover
+    ntos = lambda s: s.decode('UTF-8')
     iterkeys = lambda d: d.iterkeys()
     iteritems = lambda d: d.iteritems()
     copyitems = lambda d: d.items()