From 3c6970e0471bb8cc9f0dfc124427119d1d48db2e Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 18 Oct 2011 17:35:55 +0200 Subject: [PATCH] [bindings] fix tree traversal on windows - The file path separator is not / on all platforms, so do not use it when matching filenames. --- bindings/bindings.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bindings/bindings.py b/bindings/bindings.py index 1f8c6dc3..dc18ff4a 100644 --- a/bindings/bindings.py +++ b/bindings/bindings.py @@ -153,7 +153,8 @@ class BindingData: return funcs[0] regex = re.compile(r'\/\*\*\s(.*?)\*\/', re.DOTALL) for base, dirnames, filenames in os.walk(srcdir): - if base.endswith('/.svn'): + bname = os.path.basename(base) + if bname == '.svn': # ignore svn directories continue if not 'Makefile.am' in filenames: @@ -561,14 +562,15 @@ def parse_headers(srcdir): if not binding.options.idwsf: exclusion += ( 'idwsf_strings.h', ) for base, dirnames, filenames in os.walk(srcdir): - if base.endswith('/.svn'): + bname = os.path.basename(base) + if bname == '.svn': # ignore svn directories continue if not 'Makefile.am' in filenames: # not a source dir continue - if not binding.options.idwsf and (base.endswith('/id-wsf') or \ - base.endswith('/id-wsf-2.0') or base.endswith('/ws')): + if not binding.options.idwsf and bname == 'id-wsf' or \ + bname == 'id-wsf-2.0' or bname == 'ws': # ignore ID-WSF continue makefile_am = open(os.path.join(base, 'Makefile.am')).read()