From 625e2611c11796f84ac4f83a527bf847a8f49f89 Mon Sep 17 00:00:00 2001 From: Itamar Turner-Trauring Date: Mon, 24 Aug 2020 11:59:52 -0400 Subject: [PATCH] Address some review comments. --- src/allmydata/test/test_storage_web.py | 4 +--- src/allmydata/web/common_py3.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/allmydata/test/test_storage_web.py b/src/allmydata/test/test_storage_web.py index a3c1c7dee..9c64c2f45 100644 --- a/src/allmydata/test/test_storage_web.py +++ b/src/allmydata/test/test_storage_web.py @@ -1123,8 +1123,7 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin): # grr. json turns all dict keys into strings. so_far = data["lease-checker"]["cycle-to-date"] corrupt_shares = so_far["corrupt-shares"] - # it also turns all tuples into lists, and result is unicode (on - # Python 3 always, on Python 2 sometimes) + # it also turns all tuples into lists, and result is unicode: [(actual_b32, i)] = corrupt_shares actual_b32 = actual_b32.encode("ascii") self.failUnlessEqual([actual_b32, i], [first_b32, 0]) @@ -1153,7 +1152,6 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin): def _check_json_history(raw): data = json.loads(raw) last = data["lease-checker"]["history"]["0"] - corrupt_shares = last["corrupt-shares"] [(actual_b32, i)] = last["corrupt-shares"] actual_b32 = actual_b32.encode("ascii") self.failUnlessEqual([actual_b32, i], [first_b32, 0]) diff --git a/src/allmydata/web/common_py3.py b/src/allmydata/web/common_py3.py index 1af8c8892..06751a8e8 100644 --- a/src/allmydata/web/common_py3.py +++ b/src/allmydata/web/common_py3.py @@ -1,7 +1,7 @@ """ Common utilities that are available from Python 3. -Can eventually be merged back into twisted.web.common. +Can eventually be merged back into allmydata.web.common. """ from future.utils import PY2