Mercurial > public > mercurial-scm > hg-stable
comparison contrib/check-code.py @ 17620:efd1a4378b64
check-code: catch yield inside try/finally (with tests)
This is not allowed in Python 2.4.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Wed, 19 Sep 2012 12:29:12 +0200 |
parents | 72803c8edaa4 |
children | cf204e9829f4 |
comparison
equal
deleted
inserted
replaced
17619:431e3e827ab0 | 17620:efd1a4378b64 |
---|---|
135 (r'\w,\w', "missing whitespace after ,"), | 135 (r'\w,\w', "missing whitespace after ,"), |
136 (r'\w[+/*\-<>]\w', "missing whitespace in expression"), | 136 (r'\w[+/*\-<>]\w', "missing whitespace in expression"), |
137 (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"), | 137 (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"), |
138 (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n' | 138 (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n' |
139 r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Python 2.4'), | 139 r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Python 2.4'), |
140 (r'(\s+)try:\n((?:\n|\1\s.*\n)*?)\1\s*yield\b.*?' | |
141 r'((?:\n|\1\s.*\n)+?)\1finally:', | |
142 'no yield inside try/finally in Python 2.4'), | |
140 (r'.{81}', "line too long"), | 143 (r'.{81}', "line too long"), |
141 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'), | 144 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'), |
142 (r'[^\n]\Z', "no trailing newline"), | 145 (r'[^\n]\Z', "no trailing newline"), |
143 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"), | 146 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"), |
144 # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', | 147 # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=', |