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

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

Issue 2095663003: 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..95d17ffd8e88180a9d181cc3dd6b96f45a21980e 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):
tandrii(chromium) 2016/06/23 19:52:36 can you elaborate why this is wrong?
- return obj.encode('utf-8')
+ elif isinstance(obj, str):
+ return obj.decode('utf-8')
else:
return obj

Powered by Google App Engine
This is Rietveld 408576698