build: fix warning in python parser
authorAlexander Alekhin <alexander.alekhin@intel.com>
Fri, 11 Nov 2016 14:45:12 +0000 (17:45 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Fri, 11 Nov 2016 14:45:12 +0000 (17:45 +0300)
/usr/lib/python3.5/re.py:203: FutureWarning: split() requires a non-empty pattern match.
  return _compile(pattern, flags).split(string, maxsplit)

modules/python/src2/hdr_parser.py

index a5ecae0..da90d80 100755 (executable)
@@ -250,7 +250,7 @@ class CppHeaderParser(object):
             l = l[:npos] + l[npos3+1:]
 
         l = self.batch_replace(l, [("CV_EXPORTS_W", ""), ("CV_EXPORTS", ""), ("public virtual ", " "), ("public ", " "), ("::", ".")]).strip()
-        ll = re.split(r'\s*[,:]?\s*', l)
+        ll = re.split(r'\s+|\s*[,:]\s*', l)
         ll = [le for le in ll if le]
         classname = ll[1]
         bases = ll[2:]