1. Marc Abramowitz
  2. ScriptTest

Commits

Marc Abramowitz  committed 4c8eb7e

Fix issue 10: scripttest.backwardscompat.string fails in Python 2 when
input is a unicode

Refs https://bitbucket.org/ianb/scripttest/issue/10/scripttestbackwardscompatstring-fails-in

  • Participants
  • Parent commits 5c612c4
  • Branches issue-10

Comments (0)

Files changed (1)

File scripttest/backwardscompat.py

View file
             return string
         return str(string, "utf-8")
     else:
+        if isinstance(string, unicode):
+            return string
         return string.decode('utf-8')