Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Unified Diff: recipe_engine/third_party/expect_tests/serialize.py

Issue 2088343002: improve unicode support (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: recipe_engine/third_party/expect_tests/serialize.py
diff --git a/recipe_engine/third_party/expect_tests/serialize.py b/recipe_engine/third_party/expect_tests/serialize.py
index 7324a47b9d1a006a7051f4cef97c47e05e2be6b6..1977021456f65ae0b82d378900a933795d5384de 100644
--- a/recipe_engine/third_party/expect_tests/serialize.py
+++ b/recipe_engine/third_party/expect_tests/serialize.py
@@ -28,8 +28,8 @@ def re_encode(obj):
return {re_encode(k): re_encode(v) for k, v in obj.iteritems()}
elif isinstance(obj, list):
return [re_encode(i) for i in obj]
- elif isinstance(obj, unicode):
- return obj.encode('utf-8')
+ elif isinstance(obj, str):
+ return unicode(obj)
M-A Ruel 2016/06/23 13:12:33 use obj.decode('utf-8') since I don't think there'
martiniss 2016/06/23 17:32:14 Done.
else:
return obj

Powered by Google App Engine
This is Rietveld 408576698