Bundlebuilder list_files: Better error handling #635

Don't fail on trailing slash of the directory name
This commit is contained in:
Simon Schampijer 2009-03-30 09:49:59 +02:00
parent 720401606d
commit a7daf73fae

View File

@ -40,6 +40,8 @@ IGNORE_FILES = ['.gitignore', 'MANIFEST', '*.pyc', '*~', '*.bak', 'pseudo.po']
def list_files(base_dir, ignore_dirs=None, ignore_files=None): def list_files(base_dir, ignore_dirs=None, ignore_files=None):
result = [] result = []
base_dir = os.path.abspath(base_dir)
for root, dirs, files in os.walk(base_dir): for root, dirs, files in os.walk(base_dir):
if ignore_files: if ignore_files:
for pattern in ignore_files: for pattern in ignore_files: