comparison python/ppci/errors.py @ 182:e9b27f7193e3

Replace clear function by function also supported in python 3.2
author Windel Bouwman
date Sat, 18 May 2013 18:24:42 +0200
parents 5a7d37d615ee
children 6b2bec5653f1
comparison
equal deleted inserted replaced
181:216da5e46efc 182:e9b27f7193e3
41 def addDiag(self, d): 41 def addDiag(self, d):
42 self.diags.append(d) 42 self.diags.append(d)
43 def error(self, msg, loc): 43 def error(self, msg, loc):
44 self.addDiag(CompilerError(msg, loc)) 44 self.addDiag(CompilerError(msg, loc))
45 def clear(self): 45 def clear(self):
46 self.diags.clear() 46 del self.diags[:]
47 def printErrors(self, src): 47 def printErrors(self, src):
48 if len(self.diags) > 0: 48 if len(self.diags) > 0:
49 print('{0} Errors'.format(len(self.diags))) 49 print('{0} Errors'.format(len(self.diags)))
50 for d in self.diags: 50 for d in self.diags:
51 printError(src, d) 51 printError(src, d)