git.99rst.org
/
redacted-XKCD-password-generator.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
75337cf
)
Python3 compatibility fix in commandline_count.
author
Daniil Baturin
<redacted>
Thu, 10 Jul 2014 18:36:53 +0000
(
01:36
+0700)
committer
Daniil Baturin
<redacted>
Thu, 10 Jul 2014 18:36:53 +0000
(
01:36
+0700)
.count() doesn't work with strings in it, likely because strings
are unicode by default. Explicit b"" byte string argument works.
tests/xkcdp_tests.py
patch
|
blob
|
history
diff --git
a/tests/xkcdp_tests.py
b/tests/xkcdp_tests.py
index 4a4cdce79eef1ff7ca92632f6a354513b458e5f9..1cc67a07a9740d34a80bc4ffd27d26797b5ad7fe 100644
(file)
--- 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 = "_"
git clone https://git.99rst.org/PROJECT