diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-01-19 12:09:33 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-01-19 12:09:33 (GMT) |
commit | 31a858cbf1eca34f04dd425fa7f8d6f031e5de66 (patch) | |
tree | 927dcedfd78fc242e011610a659ec4c89cbaf2d8 /Lib/msilib | |
parent | 47670ebb0cf2fd1bff8de6cf274d004b81b68400 (diff) | |
download | cpython-31a858cbf1eca34f04dd425fa7f8d6f031e5de66.zip cpython-31a858cbf1eca34f04dd425fa7f8d6f031e5de66.tar.gz cpython-31a858cbf1eca34f04dd425fa7f8d6f031e5de66.tar.bz2 |
Issue #16620: Got rid of using undocumented function glob.glob1().
Diffstat (limited to 'Lib/msilib')
-rw-r--r-- | Lib/msilib/__init__.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/msilib/__init__.py b/Lib/msilib/__init__.py index 6d0a28f..823644a 100644 --- a/Lib/msilib/__init__.py +++ b/Lib/msilib/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) 2005 Martin v. Löwis # Licensed to PSF under a Contributor Agreement. from _msi import * -import glob +import fnmatch import os import re import string @@ -379,7 +379,13 @@ class Directory: def glob(self, pattern, exclude = None): """Add a list of files to the current component as specified in the glob pattern. Individual files can be excluded in the exclude list.""" - files = glob.glob1(self.absolute, pattern) + try: + files = os.listdir(self.absolute) + except OSError: + return [] + if pattern[:1] != '.': + files = (f for f in files if f[0] != '.') + files = fnmatch.filter(files, pattern) for f in files: if exclude and f in exclude: continue self.add_file(f) |