[tor-commits] [stem/master] Fix test_version_position for python3

atagar at torproject.org atagar at torproject.org
Fri May 24 18:47:24 UTC 2019


commit f5093b2ed67bcdad8d51d83db780c09bf142f57c
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri May 24 11:46:43 2019 -0700

    Fix test_version_position for python3
    
    Correcting a couple typing regressions that slipped in...
    
      https://trac.torproject.org/projects/tor/ticket/30597
---
 stem/descriptor/bandwidth_file.py      | 2 +-
 test/unit/descriptor/bandwidth_file.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/stem/descriptor/bandwidth_file.py b/stem/descriptor/bandwidth_file.py
index a26b2d57..1f000f50 100644
--- a/stem/descriptor/bandwidth_file.py
+++ b/stem/descriptor/bandwidth_file.py
@@ -104,7 +104,7 @@ def _date(val):
 
 
 def _csv(val):
-  return map(lambda v: v.strip(), val.split(',')) if val is not None else None
+  return list(map(lambda v: v.strip(), val.split(','))) if val is not None else None
 
 
 # mapping of attributes => (header, type)
diff --git a/test/unit/descriptor/bandwidth_file.py b/test/unit/descriptor/bandwidth_file.py
index 8cb0b942..3040c38b 100644
--- a/test/unit/descriptor/bandwidth_file.py
+++ b/test/unit/descriptor/bandwidth_file.py
@@ -85,14 +85,14 @@ new_header=neat stuff
 =====
 """.strip()
 
-WRONG_VERSION_POSITION = """
+WRONG_VERSION_POSITION = b"""
 1410723598
 file_created=2019-01-14T05:35:06
 version=1.1.0
 =====
 """.strip()
 
-RIGHT_VERSION_POSITION = """
+RIGHT_VERSION_POSITION = b"""
 1410723598
 version=1.1.0
 file_created=2019-01-14T05:35:06



More information about the tor-commits mailing list