comparison tests/coverage.py @ 4874:d9e385a7a806

Use isinstance instead of type == type
author Christian Ebert <blacktrash@gmx.net>
date Fri, 06 Jul 2007 12:02:43 +0200
parents 306055f5b65c
children 7a4d846b178f
comparison
equal deleted inserted replaced
4873:28b23b9073a8 4874:d9e385a7a806
502 return result 502 return result
503 503
504 def get_suite_spots(self, tree, spots): 504 def get_suite_spots(self, tree, spots):
505 import symbol, token 505 import symbol, token
506 for i in range(1, len(tree)): 506 for i in range(1, len(tree)):
507 if type(tree[i]) == type(()): 507 if isinstance(tree[i], tuple):
508 if tree[i][0] == symbol.suite: 508 if tree[i][0] == symbol.suite:
509 # Found a suite, look back for the colon and keyword. 509 # Found a suite, look back for the colon and keyword.
510 lineno_colon = lineno_word = None 510 lineno_colon = lineno_word = None
511 for j in range(i-1, 0, -1): 511 for j in range(i-1, 0, -1):
512 if tree[j][0] == token.COLON: 512 if tree[j][0] == token.COLON: