From: Daniil Baturin Date: Thu, 10 Jul 2014 18:36:53 +0000 (+0700) Subject: Python3 compatibility fix in commandline_count. X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=ca8e24e01585666e5e6dd533487f16b20a16dc4a;p=redacted-XKCD-password-generator.git Python3 compatibility fix in commandline_count. .count() doesn't work with strings in it, likely because strings are unicode by default. Explicit b"" byte string argument works. --- diff --git a/tests/xkcdp_tests.py b/tests/xkcdp_tests.py index 4a4cdce..1cc67a0 100644 --- a/tests/xkcdp_tests.py +++ b/tests/xkcdp_tests.py @@ -34,7 +34,7 @@ class XkcdPasswordTests(unittest.TestCase): result = subprocess.check_output( ["python", "xkcdpass/xkcd_password.py", "-w", WORDFILE, "-c", str(count)]) - self.assertTrue(result.count("\n"), count) + self.assertTrue(result.count(b"\n"), count) def test_delim(self): tdelim = "_"