mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Fix various spots where int/long and str/unicode unification
lead to type checks like isinstance(foo, (str, str)) or isinstance(foo, (int, int)).
This commit is contained in:
parent
5d7a7001d9
commit
aa97f04964
14 changed files with 46 additions and 51 deletions
|
@ -492,12 +492,11 @@ test_705836()
|
|||
def test_1229380():
|
||||
import sys
|
||||
for endian in ('', '>', '<'):
|
||||
for cls in (int, int):
|
||||
for fmt in ('B', 'H', 'I', 'L'):
|
||||
deprecated_err(struct.pack, endian + fmt, cls(-1))
|
||||
for fmt in ('B', 'H', 'I', 'L'):
|
||||
deprecated_err(struct.pack, endian + fmt, -1)
|
||||
|
||||
deprecated_err(struct.pack, endian + 'B', cls(300))
|
||||
deprecated_err(struct.pack, endian + 'H', cls(70000))
|
||||
deprecated_err(struct.pack, endian + 'B', 300)
|
||||
deprecated_err(struct.pack, endian + 'H', 70000)
|
||||
|
||||
deprecated_err(struct.pack, endian + 'I', sys.maxint * 4)
|
||||
deprecated_err(struct.pack, endian + 'L', sys.maxint * 4)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue