summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-08-21 16:27:31 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-08-21 16:27:31 (GMT)
commit79212998a8d46712edcf7c4f3fbaefca05a7b08b (patch)
treed52802b58666143b1bbe634bc2f134c121c77cab /Lib/test/test_support.py
parent48563e840b3473977f982c896d9eb7c4a74e4bff (diff)
downloadcpython-79212998a8d46712edcf7c4f3fbaefca05a7b08b.zip
cpython-79212998a8d46712edcf7c4f3fbaefca05a7b08b.tar.gz
cpython-79212998a8d46712edcf7c4f3fbaefca05a7b08b.tar.bz2
use isinstance instead of type. Use bool instead of int for flag.
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index a9d5dab..0397118 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -110,15 +110,14 @@ def bind_port(sock, host='', preferred_port=54321):
FUZZ = 1e-6
def fcmp(x, y): # fuzzy comparison function
- if type(x) == type(0.0) or type(y) == type(0.0):
+ if isinstance(x, float) or isinstance(y, float):
try:
- x, y = coerce(x, y)
fuzz = (abs(x) + abs(y)) * FUZZ
if abs(x-y) <= fuzz:
return 0
except:
pass
- elif type(x) == type(y) and type(x) in (type(()), type([])):
+ elif type(x) == type(y) and isinstance(x, (tuple, list)):
for i in range(min(len(x), len(y))):
outcome = fcmp(x[i], y[i])
if outcome != 0:
@@ -128,9 +127,9 @@ def fcmp(x, y): # fuzzy comparison function
try:
unicode
- have_unicode = 1
+ have_unicode = True
except NameError:
- have_unicode = 0
+ have_unicode = False
is_jython = sys.platform.startswith('java')