Commit 63a8d694 authored by Tim Peters's avatar Tim Peters

Repair some accidents causing Windows failures:

+ test_compare.  While None compares less than anything else, it's not
  always the case that None has the smallest id().
+ test_descr.  The output of %p (pointer) formats varies across platforms.
  In particular, on Windows it doesn't produce a leading "0x".
parent 2f704557
...@@ -45,7 +45,7 @@ def test(): ...@@ -45,7 +45,7 @@ def test():
else: else:
print "%s != %s" % (a, b) print "%s != %s" % (a, b)
# Ensure default comparison compares id() of args # Ensure default comparison compares id() of args
L = [None] L = []
for i in range(10): for i in range(10):
L.insert(len(L)/2, Empty()) L.insert(len(L)/2, Empty())
for a in L: for a in L:
......
...@@ -881,8 +881,8 @@ def specials(): ...@@ -881,8 +881,8 @@ def specials():
verify(c1 != c2) verify(c1 != c2)
verify(not c1 != c1) verify(not c1 != c1)
verify(not c1 == c2) verify(not c1 == c2)
verify(str(c1) == '<C object at 0x%x>' % id(c1)) verify(str(c1).startswith('<C object at '))
verify(repr(c1) == '<C object at 0x%x>' % id(c1)) verify(str(c1) == repr(c1))
verify(-1 not in c1) verify(-1 not in c1)
for i in range(10): for i in range(10):
verify(i in c1) verify(i in c1)
...@@ -902,8 +902,8 @@ def specials(): ...@@ -902,8 +902,8 @@ def specials():
verify(d1 != d2) verify(d1 != d2)
verify(not d1 != d1) verify(not d1 != d1)
verify(not d1 == d2) verify(not d1 == d2)
verify(str(d1) == '<D object at 0x%x>' % id(d1)) verify(str(d1).startswith('<D object at '))
verify(repr(d1) == '<D object at 0x%x>' % id(d1)) verify(str(d1) == repr(d1))
verify(-1 not in d1) verify(-1 not in d1)
for i in range(10): for i in range(10):
verify(i in d1) verify(i in d1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment