
4 Jun
2018
4 Jun
'18
11:49 a.m.
On Mon, 2018-06-04 at 21:27 +1200, Chris Packham wrote:
Moveconfig already attempts to remove empty #if/#endif blocks when there is a matching CONFIG_ being moved. Add a second pass which covers files without a match.
- pattern = r'^\s*#\s*if.*$\n^\s*#\s*endif.*$\n*'
Any reason not to use re.compile() ?
- with open(header_path) as f:
data = f.read()
- new_data = re.sub(pattern, '\n', data, flags=re.M)
--
Andy Shevchenko andriy.shevchenko@linux.intel.com
Intel Finland Oy