diff options
author | Walter Dörwald <walter@livinglogic.de> | 2004-02-12 17:35:32 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2004-02-12 17:35:32 (GMT) |
commit | 70a6b49821a3226f55e9716f32d802d06640cb89 (patch) | |
tree | 3c8ca10c1fa09e025bd266cf855a00d7d96c55aa /Lib/test/test_struct.py | |
parent | ecfeb7f095dfd9c1c8929bf3df858ee35e0d9e9e (diff) | |
download | cpython-70a6b49821a3226f55e9716f32d802d06640cb89.zip cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.gz cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.bz2 |
Replace backticks with repr() or "%r"
From SF patch #852334.
Diffstat (limited to 'Lib/test/test_struct.py')
-rw-r--r-- | Lib/test/test_struct.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index 1e1092d..0641d9b 100644 --- a/Lib/test/test_struct.py +++ b/Lib/test/test_struct.py @@ -48,8 +48,8 @@ fmt3 = '3c3b18x12h6i6l6f3d' sz = struct.calcsize(fmt) sz3 = struct.calcsize(fmt3) if sz * 3 != sz3: - raise TestFailed, 'inconsistent sizes (3*%s -> 3*%d = %d, %s -> %d)' % ( - `fmt`, sz, 3*sz, `fmt3`, sz3) + raise TestFailed, 'inconsistent sizes (3*%r -> 3*%d = %d, %r -> %d)' % ( + fmt, sz, 3*sz, fmt3, sz3) simple_err(struct.pack, 'iii', 3) simple_err(struct.pack, 'i', 3, 3, 3) @@ -120,21 +120,21 @@ tests = [ for fmt, arg, big, lil, asy in tests: if verbose: - print `fmt`, `arg`, `big`, `lil` + print "%r %r %r %r" % (fmt, arg, big, lil) for (xfmt, exp) in [('>'+fmt, big), ('!'+fmt, big), ('<'+fmt, lil), ('='+fmt, ISBIGENDIAN and big or lil)]: res = struct.pack(xfmt, arg) if res != exp: - raise TestFailed, "pack(%s, %s) -> %s # expected %s" % ( - `fmt`, `arg`, `res`, `exp`) + raise TestFailed, "pack(%r, %r) -> %r # expected %r" % ( + fmt, arg, res, exp) n = struct.calcsize(xfmt) if n != len(res): - raise TestFailed, "calcsize(%s) -> %d # expected %d" % ( - `xfmt`, n, len(res)) + raise TestFailed, "calcsize(%r) -> %d # expected %d" % ( + xfmt, n, len(res)) rev = struct.unpack(xfmt, res)[0] if rev != arg and not asy: - raise TestFailed, "unpack(%s, %s) -> (%s,) # expected (%s,)" % ( - `fmt`, `res`, `rev`, `arg`) + raise TestFailed, "unpack(%r, %r) -> (%r,) # expected (%r,)" % ( + fmt, res, rev, arg) ########################################################################### # Simple native q/Q tests. |