diff options
author | Brett Cannon <bcannon@gmail.com> | 2007-10-22 20:24:51 +0000 |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2007-10-22 20:24:51 +0000 |
commit | 4043001f5d84d4919781e34221449047d0690ac8 (patch) | |
tree | 4b4db9f0b748407480aff4f10b99ce70548bfee0 /Lib/test/test_compile.py | |
parent | 6464d471950c6ee109f82597ff70d755c127074f (diff) | |
download | cpython-git-4043001f5d84d4919781e34221449047d0690ac8.tar.gz |
Make str/str8 comparisons return True/False for !=/==.
Code that has been returning str8 becomes much more apparent thanks to this
(e.g., struct module returning str8 for all string-related formats or sqlite3
passing in str8 instances when converting objects that had a __conform__
method). One also has to watch out in C code when making a key from char *
using PyString in the C code but a str instance in Python code as that will not
longer compare equal.
Once str8 gains a constructor like the current bytes type then
test_modulefinder needs a cleanup as the fix is a little messy in that file.
Thanks goes to Thomas Lee for writing the patch for the change giving an
initial run-down of why most of the tests were failing.
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r-- | Lib/test/test_compile.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 0bdd0368d2..d6a51dd9b6 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -157,7 +157,7 @@ if 1: s256 = "".join(["\n"] * 256 + ["spam"]) co = compile(s256, 'fn', 'exec') self.assertEqual(co.co_firstlineno, 257) - self.assertEqual(co.co_lnotab, '') + self.assertEqual(co.co_lnotab, str8('')) def test_literals_with_leading_zeroes(self): for arg in ["077787", "0xj", "0x.", "0e", "090000000000000", |