comparison contrib/check-code.py @ 13160:07d08c130892

check-code: catch "except as"
author Matt Mackall <mpm@selenic.com>
date Thu, 16 Dec 2010 14:50:36 -0600
parents a861c7155f09
children 11eb53464e68
comparison
equal deleted inserted replaced
13159:3172da69ff37 13160:07d08c130892
127 # (r'in range\(', "use xrange"), 127 # (r'in range\(', "use xrange"),
128 # (r'^\s*print\s+', "avoid using print in core and extensions"), 128 # (r'^\s*print\s+', "avoid using print in core and extensions"),
129 (r'[\x80-\xff]', "non-ASCII character literal"), 129 (r'[\x80-\xff]', "non-ASCII character literal"),
130 (r'("\')\.format\(', "str.format() not available in Python 2.4"), 130 (r'("\')\.format\(', "str.format() not available in Python 2.4"),
131 (r'^\s*with\s+', "with not available in Python 2.4"), 131 (r'^\s*with\s+', "with not available in Python 2.4"),
132 (r'^\s*except.* as .*:', "except as not available in Python 2.4"),
132 (r'(?<!def)\s+(any|all|format)\(', 133 (r'(?<!def)\s+(any|all|format)\(',
133 "any/all/format not available in Python 2.4"), 134 "any/all/format not available in Python 2.4"),
134 (r'(?<!def)\s+(callable)\(', 135 (r'(?<!def)\s+(callable)\(',
135 "callable not available in Python 3, use hasattr(f, '__call__')"), 136 "callable not available in Python 3, use hasattr(f, '__call__')"),
136 (r'if\s.*\selse', "if ... else form not available in Python 2.4"), 137 (r'if\s.*\selse', "if ... else form not available in Python 2.4"),